Forum Discussion
RankX problems
- 4 years ago
ColinH here is your measure, ofcourse you already have the solution but we always want to avoid adding a column (where possible):
Rank Team Season = RANKX ( FILTER ( ALL ( TeamSeason ), TeamSeason[Season] = MAX ( TeamSeason[Season] ) ), CALCULATE ( MAX ( TeamSeason[AllSeasonsFiling] ) ), , DESC )
ColinH you can create two measures like this
_allSeasonFiling = MAX('Table 1'[AllSeasonsFiling])
_rank = RANKX(ALLSELECTED('Table 1'[Team]),[_allSeasonFiling],,DESC)
Hi, thank you so much, but it's not quite doing what I'd hoped - probably my fault for explaining badly. I wish the filter to be by team, and the result to be a table showing that team's position over multiple years. Your solution has it the other way round. I'm afraid I don't seem to be able to upload a pbix like you, so I can only show a screenshot. Here Arsenal are selected and they are incorrectly evaluating to rank 1. (This is using your provided pbix, not mine, so the data is the same as I attached earlier)
- smpa014 years agoCommunity Champion
ColinH so with this given selection, what values do you expect dax to return?
- ColinH4 years agoFrequent Visitor
I'd expect Arsenal 1992-93 to show 10 (the 10th highest _allseasonfiling), 1993-94 to show 4 and, given I provided incomplete data for 1994-95, I'd expect that to show 12.