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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jdelekta
Frequent Visitor

How to add Max to a Measure

Hello,

 

I have created a measure that calculates the date difference between different work item states. I am trying to answer the question of how long it takes to complete work after development is started but before its released to production. Which is working. However - I'd like to get the MAX of all the values so I can plot it on percentiles. The calculation is below with the names of the tables removed. I have a couple of questions:

 

1) Is there a way to wrap this measure with a MAX?

 

2) When I remove "Work Item ID" from the view the values don't display

 

Thank you.

 

jdelekta_0-1676498121016.png

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@jdelekta 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...

View solution in original post

2 REPLIES 2
PawelWrona
Resolver II
Resolver II

The value is not displayed when you take away "Work Item ID", as in RETURN statement of your measure you ask to return a value only when there is a single value of "Work Item ID". When you take it away, you make attepmt to display a measure without the context of "Work Item ID" (on total level), therefore, there is no longer single value available of "Work Item ID" and your measure returns BLANK().

 

But don't remove HASONEVALUE part from your calculation in order to have any result calculated as it won't be correct. Your aggregation variables that calculate MIN values for different states may come from different "Work Items ID", and you will not compare proper values.

In order to get proper MAX of all values available on "Work Item ID" level, Greg already provided good solution.

Greg_Deckler
Community Champion
Community Champion

@jdelekta 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...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors