cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

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.

 name category country grade training title length in hours A Soft skill Poland Director Communciation skills 5 A Soft skill Poland Director Negotiation skills 6 A Soft skill Poland Director Writing 7 A Soft skill Poland Director Presentation skills 9.5 A Technical Poland Director Excel 10 A Technical Poland Director Word 11 A Technical Poland Director Power Point 0.5 B Soft skill Italy Associate Communciation skills 5 B Soft skill Italy Associate Negotiation skills 6 B Technical Italy Associate Excel 10 B Technical Italy Associate Word 11
1 ACCEPTED SOLUTION
Super User

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

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

Super User

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

Helper II

Perfect! it works!!!

Have a great day!

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

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

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors