Forum Discussion
RankX excluding some values
Hi,
I want to exclude some value or want filter some values while calculating the Rank. I am calculating the Ranks on the basis of average ranking given on some parameters.
I am using below DAX but not getting the right answer
| Unit | Rank Check | Average of Star Rating |
| Group12 | 1 | 3 |
| Group11 | 1 | 2.76 |
| Group10 | 1 | 2.62 |
| Group9 | 1 | 2.57 |
| Group8 | 1 | 2.36 |
| Group7 | 1 | 2.33 |
| 1 | 2.29 | |
| Group5 | 1 | 2.22 |
| Group4 | 1 | 2.11 |
| 1 | 2.06 | |
| Group1 | 1 | 2 |
| Group2 | 1 | 1.95 |
| Group3 | 1 | 1.8 |
- Anonymous6 years ago
Hi Anonymous ,
Then try this measure.
Rank Without GRp 1 = IF( SELECTEDVALUE('Table'[Unit]) = "Group1", BLANK(), RANKX (FILTER(ALL('Table'),'Table'[Unit] <> "Group1"), CALCULATE(AVERAGE('Table'[Average of Star Rating]))))Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
5 Replies
- AnonymousNot applicable
HI Anonymous ,
Use this measure
Rank without Grp 1 = RANKX (FILTER(ALL('Table'),'Table'[Unit] <> "Group1"), CALCULATE(AVERAGE('Table'[Average of Star Rating])))Post this apply a visual filter
Regards,Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!- AnonymousNot applicable
Hi Harsh, Thanks for your quick response.
But I dont want to filter the Unit using visual filter I am looking for no rank if I am filtering out any group.
I have applied the same DAX and got below results
Unit Divison Ranking check Average of Star Rating Group12 1 3 Group11 2 2.76 Group10 3 2.62 Group9 4 2.57 Group8 5 2.36 Group7 6 2.33 7 2.29 Group5 8 2.22 Group4 9 2.11 10 2.06 Group1 11 2 Group2 11 1.95 Group3 12 1.8 TBA 13 Here, I am filtering out the group2 but see group2 have 11th Rank.. Instead of this Is there any way we can make it blank or remove that group?
I wan to rank them indivually like : Group1 having 11 rating out of 13 group or 11/13(its a total group count)
Regards
Uphar
- AnonymousNot applicable
Hi Anonymous ,
Then try this measure.
Rank Without GRp 1 = IF( SELECTEDVALUE('Table'[Unit]) = "Group1", BLANK(), RANKX (FILTER(ALL('Table'),'Table'[Unit] <> "Group1"), CALCULATE(AVERAGE('Table'[Average of Star Rating]))))Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)