Forum Discussion
vijayan_ja
7 years agoFrequent Visitor
DAX measure for top 10 rank using Rankx function
Dear all, i am looking for the output of top 10 values based on the category(Subject), The problem is i am working on the real time dataset, which dosen't allow to use any calculated column. ...
- 7 years ago
Hi vijayan_ja ,
Please try this:
Rank = IF ( [FlagLatest] = 1, RANKX ( FILTER ( ALLSELECTED ( RealTimeTest ), [FlagLatest] = 1 && RealTimeTest[metric_name] = MAX ( RealTimeTest[metric_name] ) ), [SumwithContext], , DESC, DENSE ) )Best regards,
Yuliana Gu
parry2k
Super User
7 years agovijayan_ja you have to break the ties somehow, why not add index column which will be unique for each record and then break ties based on that, it should be easy, no?
vijayan_ja
7 years agoFrequent Visitor
The Rand() function dosen't given the expected output.
- tex6287 years ago
Community Champion
Maybe you can add a super insignificant amount to your sum?
Like:[SumwithContext] + (RAND()/1000)
Then you rank on this measure while still displaying [SumwithContext]?