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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Syndicate_Admin
Administrator
Administrator

Sum the values of only the maximum value based on a category

Hi, I'm at the Powerbi desktop, working with a dataset where I need to sum up the SKU values by selecting the maximum in a few categories: export and account.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks @Ashish_Mathur 

Hi, @Syndicate_Admin 

Based on your description, I've created the following sample data:

vjianpengmsft_0-1716170670821.png

I've tried summing the category of the maximum value using the following metric expression:

MaxValue = 
VAR _maxvalue = CALCULATE(MAX('Table'[Value]),ALLEXCEPT('Table','Table'[Category],'Table'[SubCategory]))
RETURN SUMX(FILTER('Table','Table'[Value]=_maxvalue),'Table'[Value])

Here are the results:

vjianpengmsft_1-1716170861419.png

If you don't understand something, it would be helpful if you could provide some virtual sample data and describe the output you are looking for.

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks @Ashish_Mathur 

Hi, @Syndicate_Admin 

Based on your description, I've created the following sample data:

vjianpengmsft_0-1716170670821.png

I've tried summing the category of the maximum value using the following metric expression:

MaxValue = 
VAR _maxvalue = CALCULATE(MAX('Table'[Value]),ALLEXCEPT('Table','Table'[Category],'Table'[SubCategory]))
RETURN SUMX(FILTER('Table','Table'[Value]=_maxvalue),'Table'[Value])

Here are the results:

vjianpengmsft_1-1716170861419.png

If you don't understand something, it would be helpful if you could provide some virtual sample data and describe the output you are looking for.

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Ashish_Mathur
Super User
Super User

Hi,

Share some data, explain the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors