Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Rankx to consider a subset filtered using a variable

Hi all,
This is my measure,
OverallScoreVarianceRankNew =
var cmp = if([OverallScoreVariance]=[Overall %],0,if([Overall %]=blank(),0,1))/
var filteredusers = CALCULATE(max('KPI'[NT_UserName]),filter('KPI',cmp=1))

//  I want to rank only those people who have Overall % & ([OverallScoreVariance] <>[Overall %], thats why a filter condition is given here, now I want to rank only these usernames not sure how to achieve this
 
var OverallScore = IF( SELECTEDVALUE('KPI'[NT_UserName]) <> nt, BLANK(), CALCULATE(RANKX(ALL('KPI'[NT_UserName]),[OverallScoreVariance],,DESC,Dense),ALLEXCEPT('KPI','KPI'[NT_UserName],'KPI'[WeekNew]))) // this is my current formula which ranks everyone, not sure how to include a condition here which takes only the filteredusers for ranking

return
 
OverallScore
 
 
any help to modify this would be nice, this is a measure, 'KPI'[NT_UserName],'KPI'[WeekNew] are the data columns
Thanks

3 Replies