cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CarlsBerg999
Helper IV
Helper IV

Ranking a category (calculated column)

Hi, i have a pretty simple ranking issue im unable to resolve.

 

In an example table i have 4 rows and 2 columns. 

 

A - 5

A - 7

B - 13

B - 4

 

I want rank these categories (A and B). How do i rank them from 1 to 2 rather than from 1 to 4? The result should be B = 1 and A = 2. 

 

Thanks!

1 ACCEPTED SOLUTION
ryan_mayu
Super User II
Super User II

@CarlsBerg999 

is this what you want?

Column = RANKX(ALL('Table (2)'),CALCULATE(SUM('Table (2)'[VALUE]),ALLEXCEPT('Table (2)','Table (2)'[ID])),,DESC,Dense)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User III
Super User III

Hi,

The ranking should typically done in a measure.   Why do you want it as a column?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User II
Super User II

@CarlsBerg999 

is this what you want?

Column = RANKX(ALL('Table (2)'),CALCULATE(SUM('Table (2)'[VALUE]),ALLEXCEPT('Table (2)','Table (2)'[ID])),,DESC,Dense)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Jihwan_Kim
Community Champion
Community Champion

Picture1.png

 

Ranking measure : =
RANKX ( ALL ( Categories ), CALCULATE ( SUM ( Data[value] ) ),, DESC )

 

 

Link to the sample pbix file 

 

 


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Kudoed Authors