Forum Discussion
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.
- Anonymous5 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
- Greg_Deckler
Community Champion
Anonymous You will want to use RANKX. Take a look at this article: https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452
- AnonymousNot applicable
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.