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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
joannasokolowsk
Helper II
Helper II

MAX/MIN measure

Hi all,

I need a help with MAX/MIN measure which will be checking the max/min sum of number of hours per person (by category). 

For example, based on below datasat the max sum number of hours per person for soft skills category should be displayed as 27.5 and min sum number of hour per person for technical category should be 21.  Also there will be few slicers on the page (like grade, country etc), so the min/max number should change accordingly to filters applied. 

 

Please help me with creating this min/max measure measure. 

 

namecategorycountrygradetraining titlelength in hours
ASoft skillPolandDirectorCommunciation skills5
ASoft skillPolandDirectorNegotiation skills6
ASoft skillPolandDirectorWriting7
ASoft skillPolandDirectorPresentation skills9.5
ATechnicalPolandDirectorExcel10
ATechnicalPolandDirectorWord11
ATechnicalPolandDirectorPower Point0.5
BSoft skillItalyAssociateCommunciation skills5
BSoft skillItalyAssociateNegotiation skills6
BTechnicalItalyAssociateExcel10
BTechnicalItalyAssociateWord11
1 ACCEPTED SOLUTION

@joannasokolowsk , Try one of the two

 

minx(values(Table[name]), calculate(sum(Table[length in hours])))

or
minx(Summarize(Table,Table[category],Table[name]"_1", calculate(sum(Table[length in hours]))),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
joannasokolowsk
Helper II
Helper II

Hey,

Thank you for a such quick response! I added those measure but the result is not as expected ;/ 

For example for soft skills category the max should 27.5 as an "A" person has the highest sum number of hours for this category (person "B" has 11 hours for soft skills so it is smaller). When I apply this measure I see 38.5 which is the sum of total hours...

 

joannasokolowsk_0-1612775697555.png

 

@joannasokolowsk , Try one of the two

 

minx(values(Table[name]), calculate(sum(Table[length in hours])))

or
minx(Summarize(Table,Table[category],Table[name]"_1", calculate(sum(Table[length in hours]))),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Perfect! it works!!! 

 

Have a great day!

amitchandak
Super User
Super User

@joannasokolowsk , You can try measure like these

 

minx(values(Table[category]), calculate(sum(Table[length in hours])))

 

maxx(values(Table[category]), calculate(sum(Table[length in hours])))

 

For top Min or Max, you can use Rank or TOPN

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

TOPN https://www.youtube.com/watch?v=QIVEFp-QiOk
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hey!

Thank you for a such quick response! I added those measure but the result is not as expected ;/ 

For example for soft skills category the max should be 27.5 as an "A" person has the highest sum number of hours for this category (person "B" has 11 hours for soft skills so it is smaller). When I apply this measure I see 38.5 which is the sum of total hours...

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.