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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

SUM of values for each category

Hello,

I have a table like this one :

categorynumber
cat_15
cat_26
cat_23
cat_11
cat_3

8

 

And I want to calculate the sum of number for each category, so :

categorysum
cat_16
cat_29
cat_38

 

My final aim is to perfom a TOPN to get the N categories with the highest sum.

 

Any idea to do this stuff ?

Thank you

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

You can achieve it by TopN filter in Filters pane just as below screenshot:

TOP N Filter in Power BI with Zero DAX Code; Visual Level Filter

yingyinr_0-1671442724145.png

Best Regards

Community Support Team _ Rena
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
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

You can achieve it by TopN filter in Filters pane just as below screenshot:

TOP N Filter in Power BI with Zero DAX Code; Visual Level Filter

yingyinr_0-1671442724145.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , Sum does not seem right to me

 

for TOPN Try

 

 

CALCULATE(Sum(Table[Number]),TOPN(2,all(Table[Category]),CALCULATE(Sum(Table[Number])) , DESC),VALUES(Table[Category]))

 

TOPN: https://youtu.be/QIVEFp-QiOk

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

Top Solution Authors