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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
CarlsBerg999
Helper V
Helper V

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
Super User

@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
Super User

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
Super User

@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!




Jihwan_Kim
Super User
Super User

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 accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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