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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mastone
Frequent Visitor

Retrieving the max of a measure

I'm having trouble retrieving the maximum value of a measure (not a calculated column).   I have a measure called [Negative Impact] which is based on other measures.  The formulas are as follows:

Negative Impact = ([Question Count] / [Total Question Count] * [% Failure])
Question Count = CALCULATE(COUNTROWS(Surveys), Surveys[SVRESULT] >= 0)
Total Question Count = CALCULATE(COUNTROWS(Surveys), REMOVEFILTERS(Questions[Question]), Surveys[SVRESULT] >=0)
% Failure = CALCULATE(AVERAGE(Surveys[Result as negative %]), Surveys[SVRESULT] >= 0)
 
I want to take the maximum value of the [Negative Impact] measure with the current context filters in place.  So for example, in the table shown below, I want to grab the max value of "1.40%".
 
mastone_1-1680819213005.png

The [Max Negative Impact] column above should be the 1.40% but n matter what I do I amost always just get a 1.  I've tried just the normal MAXX(surveys, [Negative Impact]) and it results in 1.  Many many other combinations of things and it almost always results in 1.   Any ideas?

 

Ultimately what I want to do is calculate [Negative Impact] / [Max Negative Impact] to normalize the max impact to 100% then next to some smaller percent, etc. So for example, in the image above, a new column would be added resulting in the first row being equal to 100% (1.40/1.40), the second as 76% (1.06/1.40), third row as 73% (1.02/1.40) and so on and so forth . If there is a quicker way to get to that....that's great.

 

 


 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@mastone This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Wilson_
Super User
Super User

Hello mastone,

 

Without knowing anything else about your data model, it might work if you wrapped surveys with ALLSELECTED in your MAXX function. I haven't used it a ton but to my knowledge, ALLSELECTED is similar to ALL, but it keeps filter contexts that came from outside the visual.

 

If that doesn't work, can you please provide your pbix (or a sample version)?


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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