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
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])

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

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])

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

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

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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

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.