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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Using overall maximum for a gauge visual

Hi,

 

I have a dataset of student performance data with test results, student id and various demographic details. I have created a 'profile' page for each student containing demographic data as well as the test result data - this is obtained using the drill-through option. What I'm interested in showing is a gauge with the student's test result compared to the maximum mark achieved by any student in the dataset (this would be the max value of the gauge). To do this I created a measure as follows:

 

Maximum Student Score = CALCULATE(MAX('Student Data'[FINAL_MARKS]), ALL('Student Data'[ID]))

 

The problem is that every time I open the student profile page using the drill-through method, the maximum value is always the same as the student's test score (so the gauge is always full). Is my measure defined incorrectly, or is there something else that I am not doing right?

 

Thank you,

 

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

hi  @Anonymous 

You may need to use this measure 

Maximum Student Score = CALCULATE(MAX('Student Data'[FINAL_MARKS]), ALL('Student Data'))

or

Maximum Student Score = CALCULATE(MAX('Student Data'[FINAL_MARKS]), ALLEXCEPT('Student Data', 'Student Data'[ID]))

 

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept/

 

Regards,

Lin

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

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

You may need to use this measure 

Maximum Student Score = CALCULATE(MAX('Student Data'[FINAL_MARKS]), ALL('Student Data'))

or

Maximum Student Score = CALCULATE(MAX('Student Data'[FINAL_MARKS]), ALLEXCEPT('Student Data', 'Student Data'[ID]))

 

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept/

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-lili6-msft  - that worked! Thank you very much for that.

Anonymous
Not applicable

Whether it's correct or not depends on what filters are in place at the time this measure is being applied and what your model looks like.

If you filter on the name of the student, then this ALL filter does not do anything as long as the names are unique.

If you want to remove all filters from the 'Student Data' table, you should use ALL( 'Student Data' ).

Best
D
amitchandak
Super User
Super User

Try like

 

Maximum Student Score = CALCULATE(MAX('Student Data'[FINAL_MARKS]), ALL('Student Data'))

or
Maximum Student Score = MAXX(ALL('Student Data'),'Student Data'[FINAL_MARKS])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.