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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
matthewpk
New Member

Sum minimum values for all categories

Hello,

 

I'm looking for help in summing the lowest values for every category. I understand I can throw in all the data and then run a min formula, that will give me a minimum value for every aggregate or category but won't give me the sum of all the minimum values. The example is as follows:

- Using the min function and showing all data in a table, will show a grand total of 1 but will accurately show that A=1, B=2, C=4

- What I need is a grand total of 7 because the sum of all mins is a=1 + b=2 + c=4

 

 I need this because I want to be able to show charts & graphs with this overall sum as opposed to having to walk through an entire table, this data set has a few 10s of thousands of line items.

 

Category   Value

a                 1

a                 2

b                 2

b                 2

c                 4

c                 7

1 ACCEPTED SOLUTION

Hi Matt, thank you for replying.

Unfortunately, this didn't work for me, it provided the following result 

 

Category   Value   Current Result    Desired Result

a                 1           1                         1

a                 2           2                         

b                 2           2                         2

b                 2           2                         

c                 4           4                         4

c                 7           7                         

 

I think I found the answer by using the following:

=IF( CALCULATE(min(table[value]), ALLEXCEPT(table[category])) <> table[value], CALCULATE(min(table[value]), ALLEXCEPT(table[category])), 0)

It still isn't ideal because there seem to be multiple min values in some categories and it sums all of them. I used other filters in the calculate formula to continue to exclude values. I might have to go to a rank function to make sure I don't double count minimum values

View solution in original post

2 REPLIES 2
MattAllington
Community Champion
Community Champion

Try this

 

sumx(values(table[category]), calculate(min(table[value])))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Hi Matt, thank you for replying.

Unfortunately, this didn't work for me, it provided the following result 

 

Category   Value   Current Result    Desired Result

a                 1           1                         1

a                 2           2                         

b                 2           2                         2

b                 2           2                         

c                 4           4                         4

c                 7           7                         

 

I think I found the answer by using the following:

=IF( CALCULATE(min(table[value]), ALLEXCEPT(table[category])) <> table[value], CALCULATE(min(table[value]), ALLEXCEPT(table[category])), 0)

It still isn't ideal because there seem to be multiple min values in some categories and it sums all of them. I used other filters in the calculate formula to continue to exclude values. I might have to go to a rank function to make sure I don't double count minimum values

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors