Forum Discussion
Getting wrong Ranking on date filter
- 5 years ago
Hi vin26 ,
Sorry for late back.
Please try to create a date table and use its column as slicer. I modified the formula, please try again.
Date = CALENDAR(MIN(country_projection[date]),MAX(country_projection[date]))Measure 2 = RANKX ( ALLSELECTED ( country_projection ), CALCULATE ( SUM ( country_projection[projection] ), FILTER ( ALLEXCEPT ( country_projection, country_projection[country] ), country_projection[date] >= MIN ( 'Date'[Date] ) && country_projection[date] <= MAX ( 'Date'[Date] ) ) ), , DESC, DENSE ) - 5 years ago
Hi v-xuding-msft Thanks a lot for the solution, this works fine. Excellent!
I have also got another logic which also works for my requirement:
SumCountry = SUM(country_projection[projection]) RankCountry = IF( ISFILTERED(country_projection[date]), RANKX( ALLSELECTED(country_projection[country]),[SumCountry],,DESC,Skip ) )
HI vin26 ,
The scresnhot just doen't help me with no description on why it is wrong.
Why do you think it is wrong? What you are expecting as output when you filter on date?
Thanks,
Pragati
- vin265 years agoResolver I
Hi Pragati11 in the screenshot attached 'Projections' are sorted in descending order, my expectation is to get ranking in 1,2,3,4,... order, but if you see the measure 'Rank' shows 1,1,1,1,1...
- Pragati115 years agoSuper User
- vin265 years agoResolver I
Pragati11 Please find the sample file in below link, there are 30K rows of data, I haved reduced it to 1k
https://www.dropbox.com/s/qphhj10lu5qjta7/Ranking.pbix?dl=0