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
ronlolololo
Helper I
Helper I

Calculate Max Return Text

Hi, I am playing around DAX right now.  Let's say i have a table have the following data. And I want to create a measure returning the state of highest value that day.

 

 

ronlolololo_0-1595802735487.png

 

So first I tried. 

VAR ___Date = MAX(Table1[Date])


Return 

CALCULATE(MAX(Table1[State]),FILTER(Table1, Table1[Date] = ___Date))
 
The measure shows C, why is this ? (Even though three states have the exact same date and case)
 
Following this I tried another measure.

 

Measure = 

VAR ___Date = MAX(Table1[Date])

VAR ___MaxCase = CALCULATE(MAX(Table1[Case]),FILTER(Table1, Table1[Date] = ___Date))

Return

CALCULATE(MAX(Table1[State], FILTER(Table1, Table1[Date] = ___Date && Table1[Case] = ___MaxCase)))

 

This measure shows Error becuase of single value cannot be determined. Understandable, why this measure gives error but the first one is not?  

1 ACCEPTED SOLUTION
andre
Memorable Member
Memorable Member

well, since your Date and Case values are the same for all three recoreds, filtering anything on those columns would not make any differences if you filter condition is the same as the filter will always return the same three records.  "C" is greater than "AAA" therefore, Max(State) will always return "C" as long as it can see all three records. 

 

What are you expecting to see?

View solution in original post

1 REPLY 1
andre
Memorable Member
Memorable Member

well, since your Date and Case values are the same for all three recoreds, filtering anything on those columns would not make any differences if you filter condition is the same as the filter will always return the same three records.  "C" is greater than "AAA" therefore, Max(State) will always return "C" as long as it can see all three records. 

 

What are you expecting to see?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.