Forum Discussion

CarlsBerg999's avatar
CarlsBerg999
Icon for Helper V rankHelper V
5 years ago
Solved

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!

  • CarlsBerg999 

    is this what you want?

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

3 Replies

  • CarlsBerg999 

    is this what you want?

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

  • Hi,

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