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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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