Forum Discussion
Problems with DAX RankX
I have a table containing Country names and Priority Orders
Country Priority
UK 1
US 1
NL 2
and another table containing a measure that sums a value
What I want is
Rank Priority Country SumofValue
1 1 US 1000
2 2 NL 900
3 1 UK 800
But what I am getting is the following because it's ranking by country within the Priority groups
Rank Priority Country SumofValue
1 1 US 1000
1 2 NL 900
2 1 UK 800
My DAX is al follows
hi GWoodhouse
try like:
Country Rank =Rankx(all(Country[CountryName]),CALCULATE[MySumMeasure], ALL(Country[Priority]),,desc,Dense)
3 Replies
- FreemanZ
Super User
hi GWoodhouse
try like:
Country Rank =Rankx(all(Country[CountryName]),CALCULATE[MySumMeasure], ALL(Country[Priority]),,desc,Dense)- GWoodhouseNew Member
PERFECT!
Now please explain why that works 😉
- FreemanZ
Super User
[MySumMeasure], as a measure, has an implicit CALCULATE, which converts the row context - Priority, to filter context.