Forum Discussion
Ranking based on two dimensions
Hi Experts
I have an issue in ranking
I have a table which contains three columns. first is Reportname, second is userid, third is count of views. What i need is i neeed to rank the user report by count of views. I have tried so hard and i cannot achieve it.. Can anyone help me? The below is the snapshot of my requirement. Im using a direct query environment. so i cannot use functions suc as earlier.
| report | user | count of views | required rank |
| R1 | U1 | 3 | 4 |
| R1 | U2 | 4 | 3 |
| R1 | U3 | 2 | 5 |
| R1 | U4 | 5 | 2 |
| R1 | U6 | 7 | 1 |
| R1 | U8 | 2 | 6 |
| R2 | U1 | 6 | 1 |
| R2 | U3 | 2 | 3 |
| R2 | U4 | 3 | 2 |
ranking method need to be unique ranking. Can anyone help me. This is little bit urgent
- Anonymous3 years ago
Hi SriGaG ,
Please try:ranking = RANKX(FILTER(ALL('Table1'),'Table1'[report]=MAX('Table1'[report])),[count of views],,DESC,Dense)Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
4 Replies
- Ashish_Mathur
Super User
Hi,
Assuming Count of value is a measure, write this measure
Measure = rankx(all(Data[user]),[Count of value])
Hope this helps.
- Ashish_Mathur
Super User
Share the download link of the PBI file.
- AnonymousNot applicable
Hi SriGaG ,
Please try:ranking = RANKX(FILTER(ALL('Table1'),'Table1'[report]=MAX('Table1'[report])),[count of views],,DESC,Dense)Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum