Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I've read a lot of postings on this, but I just can't seem to get it to work. I have a base table that looks like this:
| Thingy (Unique) | RankingNumber |
| a | 12345646 |
| b | 9988544 |
| c | 54654 |
| d | 654654654 |
| e | 654654654 |
| f | 89191813 |
I want to put this into a visual to and add a measure showing the rank like this:
| Thingy (Unique) | RankingNumber | Rank |
| a | 12345646 | 3 |
| b | 9988544 | 2 |
| c | 54654 | 1 |
| d | 654654654 | 5 |
| e | 654654654 | 6 |
| f | 89191813 | 4 |
So when I filter it by A and E for instance, I get:
| Thingy (Unique) | RankingNumber | Rank |
| a | 12345646 | 1 |
| e | 654654654 | 2 |
I've tried this, but I get an error saying it can't find a single value for RankingNumber
RANKX(ALLSELECTED(MyTable),MyTable[RankingNumber],,DESC)
And I've tried these, but everything has the same value for every row corresponding to the count of total rows in MyTable
RANKX(ALLSELECTED(MyTable),MyTable[RankingNumber],MAX(MyTable[RankingNumber]),DESC)
RANKX(ALLSELECTED(MyTable),MyTable[RankingNumber],CALCULATE(SUM(MyTable[RankingNumber])),DESC)
Any help would be greatly appreciated!
Solved! Go to Solution.
RANK is a better choice than RANKX for most scenarios. Try this measure:
Rank =
RANK ( ALLSELECTED ( MyTable ), ORDERBY ( MyTable[RankingNumber], ASC ) )
Proud to be a Super User!
RANK is a better choice than RANKX for most scenarios. Try this measure:
Rank =
RANK ( ALLSELECTED ( MyTable ), ORDERBY ( MyTable[RankingNumber], ASC ) )
Proud to be a Super User!
That worked! Thanks!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 25 |