Forum Discussion
RANKX issue
- 6 years ago
Hi Anonymous ,
Please create measures like this.
Measure = CALCULATE( SUM(Sales[Sale 2014]), FILTER( ALL(Sales), Sales[Month] = MAX(Sales[Month]) && Sales[CountryRegion] = MAX(Sales[CountryRegion]) ) )Measure 2 = VAR x = RANKX( FILTER( ALLSELECTED(Sales), Sales[Month] = MAX(Sales[Month]) ), [Measure], , ASC, Dense ) VAR y = RANKX( FILTER( ALLSELECTED(Sales), Sales[CountryRegion] = MAX(Sales[CountryRegion]) ), [Measure], , ASC, Dense ) RETURN IF( HASONEFILTER(Sales[CountryRegion]), x, y )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lionel-msft thank you for this, so the way i am looking to do it, is if you added your country to sit below the month on the left of matrix, you would have your ranking by month but whne you open up the month it then will give you the ranking for the countries in that month so based on the 4 countries it would rank them 1 to 4 then if i was to drill into the the country i could then get more infornation etc
Hi Anonymous ,
Please create measures like this.
Measure =
CALCULATE(
SUM(Sales[Sale 2014]),
FILTER(
ALL(Sales),
Sales[Month] = MAX(Sales[Month]) && Sales[CountryRegion] = MAX(Sales[CountryRegion])
)
)Measure 2 =
VAR x =
RANKX(
FILTER( ALLSELECTED(Sales), Sales[Month] = MAX(Sales[Month]) ),
[Measure],
, ASC, Dense
)
VAR y =
RANKX(
FILTER( ALLSELECTED(Sales), Sales[CountryRegion] = MAX(Sales[CountryRegion]) ),
[Measure],
, ASC, Dense
)
RETURN
IF(
HASONEFILTER(Sales[CountryRegion]),
x, y
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.