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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
EMSSS22
Helper I
Helper I

MAX Dax

 

I am trying to show the MAX value from this column which is made up from a measure

The first picture displays a when i drill down I see all the milages but when i drill back up I get a random number (235,729) when I want to be seeing the MAX value (175,884). 

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @EMSSS22 

please try

Miles (in selected date range) 2 =
MAXX ( VALUES ( 'Table'[VehicleNumber] ), [Miles (in selected date range)] )

View solution in original post

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @EMSSS22 

 

You can try the following methods. IF [Miles] is a measure.

Measure = IF(HASONEVALUE('Table'[VehicleNumber]),[Miles],MAXX('Table',[Miles]))

vzhangti_0-1676427615493.pngvzhangti_1-1676427624057.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for your response - the issue is when I drill back up on the matrix it's still giving me a random number

 

tamerj1
Super User
Super User

Hi @EMSSS22 

please try

Miles (in selected date range) 2 =
MAXX ( VALUES ( 'Table'[VehicleNumber] ), [Miles (in selected date range)] )

Thank you this worked!!!!

Anonymous
Not applicable

Hi @EMSSS22 

 

As far as I understand, you want to get maximum value based on unitnumber, for this you should write a dax code like in the example below.

MAXMiles = CALCULATE(MAX('Table (3)'[Miles]),ALLEXCEPT('Table (3)','Table (3)'[unitNumber]))

 

Since the value you get in the matrix is a numerical value, it will automatically enter the sum operation, so you should choose max instead of sum in the field you are calculating, as I show in the screenshot.

 

EzgiAslankara_0-1676382697375.png

EzgiAslankara_1-1676382714107.png

 

Best regards,

Ezgi Naz Aslankara

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
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.

Top Solution Authors