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
Syndicate_Admin
Administrator
Administrator

Show maximum value in an array

Hello, I hope you are well

I need to create a measure that allows you to display the maximum value of a column. The funny thing is that this value can vary depending on the filters used.

categorynumberMaximum
A0,545983470,94512971
B0,028680990,94512971
C0,54452680,94512971
D0,198681940,94512971
E0,096332490,94512971
F0,945129710,94512971
G0,023016430,94512971
H0,619615570,94512971

I've tried MAXA and MAXX and the formula doesn't work for me 😞

Thanks a lot!

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

You could use ALL(), ALLSELECTED() and ALLEXCEPT() function to get different result.

ALL() function could be used to calculate the max value for entire table.

https://docs.microsoft.com/en-us/dax/all-function-dax 

ALLSELECTED() function could be used to calculate the max value for filtered table.

https://docs.microsoft.com/en-us/dax/allselected-function-dax 

ALLEXCEPT() function could be used to calculated the max value for groups.

https://docs.microsoft.com/en-us/dax/allselected-function-dax 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

You could use ALL(), ALLSELECTED() and ALLEXCEPT() function to get different result.

ALL() function could be used to calculate the max value for entire table.

https://docs.microsoft.com/en-us/dax/all-function-dax 

ALLSELECTED() function could be used to calculate the max value for filtered table.

https://docs.microsoft.com/en-us/dax/allselected-function-dax 

ALLEXCEPT() function could be used to calculated the max value for groups.

https://docs.microsoft.com/en-us/dax/allselected-function-dax 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
FrankAT
Community Champion
Community Champion

Hi @Syndicate_Admin ,

you can do it like this:

 

09-06-_2021_00-26-44.png

 

Max of selected values = 
    CALCULATE ( 
        MAX ( 'Table'[number] ) ,
        ALLSELECTED ( 'Table'[number] )
    )

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

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.