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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BE123
New Member

Spending by Category for Top Spenders

Hi, 

I'm trying to create a measure that I can use on a table visual to display spending by category using only data from members who have spent above a certain total amount in the filtered time range.  

The data table looks similar to this:

 Data.png

 

I am looking to only include values from members who have spent above $4000 total across all categories.

I used the following measure to find the total spent by these high-spending customers, but I really cannot figure out how to write a measure that will allow me to break it down by category.  

HCCTotalPaid =
var table1 = SUMMARIZE('ExampleTable','ExampleTable'[Customer], "SumPaid", SUM('ExampleTable'[PaidAmt]))
return SUMX(FILTER(table1, [SumPaid] >= 4000), [SumPaid])
 
Any advice would be appreciated.  Thank you!

 

 

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

It is not clear what is the output you are expecting.

 

Try this:

 

a) Add the measure:

Category Total = 
var summaryTable = Filter(SUMMARIZE('Table','Table'[Category], "sumamt", CALCULATE( SUM('Table'[PaidAmt]))), [sumamt] >= 4000 )

var c = COUNTROWS(summaryTable) -- Testing! ... RETURN C

return CALCULATE( sum('Table'[PaidAmt]), summaryTable)

 

b) Drag a table visual

       Add Category, measure "Category Total" and Sum of "PaidAmt" and check the output match your requirements.

 

If yes, then tune to your requirements. (like formatting the measure, building the rest)

 

If no, copy the data to excel, and paste again here, and the output you are expecting.

This helps to test!

View solution in original post

1 REPLY 1
sevenhills
Super User
Super User

It is not clear what is the output you are expecting.

 

Try this:

 

a) Add the measure:

Category Total = 
var summaryTable = Filter(SUMMARIZE('Table','Table'[Category], "sumamt", CALCULATE( SUM('Table'[PaidAmt]))), [sumamt] >= 4000 )

var c = COUNTROWS(summaryTable) -- Testing! ... RETURN C

return CALCULATE( sum('Table'[PaidAmt]), summaryTable)

 

b) Drag a table visual

       Add Category, measure "Category Total" and Sum of "PaidAmt" and check the output match your requirements.

 

If yes, then tune to your requirements. (like formatting the measure, building the rest)

 

If no, copy the data to excel, and paste again here, and the output you are expecting.

This helps to test!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.