- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Rankx is Incorrect when similar ranked column added to table
I'm using RANKX to rank the number of "Monthly Lines" based on a column called "Parent and TC City".
The above rank work fine.
If I add the field "Parent Org" to the table, then the ranking is incorrect:
My measure for rank is:
Any idea what's going on here?
Any help would be appreciated!
Link to Sample Rankx problem https://1drv.ms/u/s!Aq5dyjpfjB3Ug9xgh8R7OSESIUJGww?e=HJ7idb
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Would something like this help?
Rank TC Parent City 2 =
RANKX(
ALL( 'Table'[Parent and TC City], 'Table'[Parent Org] ),
[Monthly Lines]
)
It seems to work in both of your scenarios.
Let me know how this works.
pbix: Rankx Problem.pbix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

If you are using a Matrix Visual, this video would help:
https://www.youtube.com/watch?v=y2FFjfRD-Bo
IF you are using a Table Visual, this video would help:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

It is because when you are including Parent Org, the context is getting changed. To avoid the context change you can use a table in your Rank Dax by cross joining the 'Parent and TC City' and 'Parent Org'. I have verified it and it gives the correct result.
My Dax looks like
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Would something like this help?
Rank TC Parent City 2 =
RANKX(
ALL( 'Table'[Parent and TC City], 'Table'[Parent Org] ),
[Monthly Lines]
)
It seems to work in both of your scenarios.
Let me know how this works.
pbix: Rankx Problem.pbix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I posted the link to the Power BI that shows the problem - Thanks

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-30-2023 06:03 AM | |||
07-26-2023 03:43 AM | |||
07-18-2024 06:44 AM | |||
11-28-2023 02:50 AM | |||
Anonymous
| 08-24-2021 10:22 PM |
User | Count |
---|---|
137 | |
107 | |
84 | |
59 | |
46 |