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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NNaj
Helper IV
Helper IV

Simple Rank/rankx of a group

 

Hi All, 

 

I have the below table. Each company has a value for attributes A, B or C. I want to rank each company based on the sum of all its attribute values.

 

CompanyAttributeValueSum of values per companyRank

Apple

A164

Apple

B264
AppleC364
TeslaA493
TeslaB593
MicrosoftA6132
MicrosoftB7132
Airbus

A

8261
AirbusB9261
AirbusC9261

 

I need help with the 2 columns on the right (sum and rank)

The rank needs to be the same for all rows for the company so that I can use this in a visual.

 

Any help will be greatly appreciated. Thank you.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@NNaj , Try like

 

Sum of values per = calculate(sum(Table[Value]), allexpect(Table, Table[Company]))

or

Sum of values per = calculate(sum(Table[Value]), filter(allselected(Table, Table[Company]) = max(Table[Company])))

 

Rank = rankx(allselected(Table[Company]),calculate(sum(Table[Value])))

or

Rank = rankx(allselected(Table[Company]),[Sum of values per])

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@NNaj , Try like

 

Sum of values per = calculate(sum(Table[Value]), allexpect(Table, Table[Company]))

or

Sum of values per = calculate(sum(Table[Value]), filter(allselected(Table, Table[Company]) = max(Table[Company])))

 

Rank = rankx(allselected(Table[Company]),calculate(sum(Table[Value])))

or

Rank = rankx(allselected(Table[Company]),[Sum of values per])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.