Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

RANKING BASED ON COUNT

Hi Team,

 

Newbie here,

 

Is it possible to create a calculated column that will rank an ID based on count of a specific rows in a column.

 

For Example:

 

Below is the RAW DATA

 

Below is is the table that contains the RANK based on count of "A" in TYPE column

 

 

Thank you so much for the help! I would really appreciate it.

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    According to my understanding, you want to rank by the number of type A of each ID, please try the following formula:

    Count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[ID]=MAX('Table'[ID]) && 'Table'[TYPE]="A"))
    
    Rank by Count = RANKX(ALL('Table'),[Count],,DESC,Dense)

    The final output is shown below:

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies