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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
marshallthomson
Frequent Visitor

Chart of top 5 categories by combined $ regardless of # of transactions comprising category value

Hi all,

 

I'm trying to create a chart showing the top 5 categories by combined value, regardless of how many transactions make up the combined value. Right now when I put a top 5 filter on the visual, it shows the values for the top 5 transactions grouped by category, but these are often spread across only 3 or 4 categories. 

 

Do I have to pre-aggregate this data in a table in SQL or elsewhere in PBI before creating this chart? Or is there a way using different filtering or DAX that I can achieve this?

 

Cheers

1 ACCEPTED SOLUTION
marshallthomson
Frequent Visitor

Never mind, Chat GPT helped. It suggested making a combined value measure by summarising to a table first, then iterating over that with a SUMX:

 

 

CombinedCategoryValue = SUMX(SUMMARIZE('Data', 'Data'[Category], "Category", SUM('Data'[Value])), [Category])

 

 

Then, applying the top N filter to this field (and 'by' this field too) gives the correct number of categories in the visual.

View solution in original post

1 REPLY 1
marshallthomson
Frequent Visitor

Never mind, Chat GPT helped. It suggested making a combined value measure by summarising to a table first, then iterating over that with a SUMX:

 

 

CombinedCategoryValue = SUMX(SUMMARIZE('Data', 'Data'[Category], "Category", SUM('Data'[Value])), [Category])

 

 

Then, applying the top N filter to this field (and 'by' this field too) gives the correct number of categories in the visual.

Helpful resources

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

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.