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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
EllenG
Frequent Visitor

Max (date) measure error message

Would appreciate help understanding why the below measure isn't working - the error is "a single value for Delivery Date cannot be deterimined. This can happen ...when the column contains may values without specifying an aggreggation."
 
thank you!
 
LastOrdered = CALCULATE(max(Sales[Delivery Date],filter(Sales, Sales[Amount]>0)))
1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @EllenG ,

Just as amitchandak mentioned,Wrongly place parenthesis.

the following data,base data:

v-luwang-msft_0-1621498372625.png

If you want to determine if there is an Amount greater than 0 for that day and output the date if there is, then use the following measure,just what  amitchandak  provided:

LastOrdered = CALCULATE(max(Sales[Delivery Date]),filter(Sales, Sales[Amount]>0))

v-luwang-msft_1-1621498541436.png

 

 

If you want to get the largest date of all dates with amount > 0, then use the following measure:

LastOrdered = CALCULATE(max(Sales[Delivery Date]),filter(ALL(Sales), Sales[Amount]>0))

v-luwang-msft_2-1621498575907.png

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @EllenG ,

Just as amitchandak mentioned,Wrongly place parenthesis.

the following data,base data:

v-luwang-msft_0-1621498372625.png

If you want to determine if there is an Amount greater than 0 for that day and output the date if there is, then use the following measure,just what  amitchandak  provided:

LastOrdered = CALCULATE(max(Sales[Delivery Date]),filter(Sales, Sales[Amount]>0))

v-luwang-msft_1-1621498541436.png

 

 

If you want to get the largest date of all dates with amount > 0, then use the following measure:

LastOrdered = CALCULATE(max(Sales[Delivery Date]),filter(ALL(Sales), Sales[Amount]>0))

v-luwang-msft_2-1621498575907.png

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

amitchandak
Super User
Super User

@EllenG , Try like

 

LastOrdered = CALCULATE(max(Sales[Delivery Date]),filter(Sales, Sales[Amount]>0))

 

Wrongly place parenthesis

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.