Forum Discussion

EMSSS22's avatar
EMSSS22
Icon for Helper I rankHelper I
3 years ago
Solved

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

 

 

  • Hi EMSSS22 

    please try

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

5 Replies

  • Anonymous's avatar
    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.

     

     

    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

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi EMSSS22 

    please try

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

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, EMSSS22 

     

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

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

    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.

    • EMSSS22's avatar
      EMSSS22
      Icon for Helper I rankHelper I

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