Forum Discussion
Rankx Issue
- 5 years ago
Ok collinq - I am not seeing something. When I do a simple RANKX, I am getting some groupings I don't understand, and rank 8 is missing.
I don't know why it is doing that. Perhaps someone a bit better at DAX would see the issue. TomMartens Greg_Deckler perhaps.
That issue aside, the following measure does rank based on the dates selected in the slicer (see file attached) but again with a few skipped items and a few grouped together.ALLSELECTED RankX = RANKX( ALLSELECTED(Margin), [Total Gross Margin] ) Total Gross Margin = SUM(Margin[Gross Margin])For example, selecting April shows this:
I cannot for the life of me figure out where ranked item #2 went. I know why #4 is repeated - same value, But not why #7 is repeated.
Here is my PBIX file. All data is in it, no need to connect to outside files. I had to clean your data up a bit collinq - there was no customer 4661 in your customer table, so filtered that out, and got rid of all zeros and blanks for testing.
Glad to help out collinq - RANKX() is one of the more finicky functions where you have to make sure you are removing the filters correctly. Add some slicers, and filters, and you often have to tweak the measure to handle the new data.
Hope your project goes smoothly.