Forum Discussion
Ranking
Hi,
Your help on this will be appreciated.
I'm trying to do top 5 projects by users using the below dax.
| Name | Top 5 |
| AB | 5 |
| BB | 4 |
| AC | 3 |
| AD | 2 |
| BC | 1 |
| CC | 1 |
| CD | 1 |
| EF | 1 |
| FF | 1 |
| EE | 1 |
| AA | 1 |
| BF | 1 |
| Name | Top 5 |
| AB | 5 |
| BB | 4 |
| AC | 3 |
| AD | 2 |
| BC | 1 |
Thanks in advance.
7 Replies
- parry2kSuper User
Emmy66 you can simply use TopN in the filter pane rather than writing a Rank measure.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- parry2kSuper User
Emmy66 looking closely, you need to break the tie, seems like the one you are getting rank 1, probably number of projects are the same and that's why they are getting the Rank 1, check here on how to break the tie (scroll down and read Break Tie section)
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- Emmy66Helper V
Hi parry2k , thanks for your prompt reply, very much appreciated. I've tried out the approach on the link you mentioned but it didn't work for me (See below).
On using TopN filter, I also tried that but it returns all the records as I mentioned earlier which I believe is because of the ties.
VAR DepartRank = RANKX(ALL(User[First_LastName]),([NoOfProjects]+INT(CALCULATE(MIN(Dates[Date]))) / 100000))RETURNIF(DepartRank<=5, ([NoOfProjects]+INT(CALCULATE(MIN(Dates[Date]))) / 100000), BLANK())Any further ideas/solution will be appreciated.- Emmy66Helper V
I have resolved the issue using rand() by applying these methods.
Top 5 Projects =VAR ProjRank = RANKX(ALL(User[First_LastName]),[NoOfProjects],,DESC)RETURNIF(ProjRank<=5, [NoOfProjects], BLANK())2nd: TieBreaker = Top 5 Projects +Rand() and then used TopN to select Top5 based on TieBreaker measure.
Thanks again parry2k for trying to assist.
- Emmy66Helper V