Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
yolandacb
Helper I
Helper I

ytd A table of multiple values was supplied where a single value was expected

I am trying to calculate a table where I can see the YTD values with this DAX:

 

Is YTD = IF ( 'Append'[Attribute - Date] >= DATE ( YEAR ( DISTINCT ( 'Append'[Date Ref.EoMonth] ) ), 1, 1 ) && 'Append'[Attribute - Date] <= DISTINCT ( 'Append'[Date Ref.EoMonth] ), "YTD", "Other" )

 

But I get error: A table of multiple values was supplied where a single value was expected

1 ACCEPTED SOLUTION
Kedar_Pande
Super User
Super User

@yolandacb 

You can correct the DAX formula:

Is YTD = 
IF (
'Append'[Attribute - Date] >= DATE ( YEAR ( MAX ( 'Append'[Date Ref.EoMonth] ) ), 1, 1 ) &&
'Append'[Attribute - Date] <= MAX ( 'Append'[Date Ref.EoMonth] ),
"YTD",
"Other"
)

Dates from 2024-01-01 to 2024-09-30 will be marked as YTD.
Other dates will be marked as Other.

 

๐Ÿ’Œ If this helped, a Kudos ๐Ÿ‘ or Solution mark would be great! ๐ŸŽ‰
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

4 REPLIES 4
Kedar_Pande
Super User
Super User

@yolandacb 

You can correct the DAX formula:

Is YTD = 
IF (
'Append'[Attribute - Date] >= DATE ( YEAR ( MAX ( 'Append'[Date Ref.EoMonth] ) ), 1, 1 ) &&
'Append'[Attribute - Date] <= MAX ( 'Append'[Date Ref.EoMonth] ),
"YTD",
"Other"
)

Dates from 2024-01-01 to 2024-09-30 will be marked as YTD.
Other dates will be marked as Other.

 

๐Ÿ’Œ If this helped, a Kudos ๐Ÿ‘ or Solution mark would be great! ๐ŸŽ‰
Cheers,
Kedar
Connect on LinkedIn

Actually this worked!

Thank you.

What about if I need the sum to start 2024-04-01?

shafiz_p
Super User
Super User

Hi @yolandacb  You are getting this error because of DINTINCT function. The DISTINCT function returns a table of unique values, but the IF function expects a single value for comparison. So use aggregator function which returns a single value for example,  MAX. 


Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)