Forum Discussion
Anonymous
4 years agoNot applicable
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
Thanks
3 Replies
- AnonymousNot applicable
amitchandak parry2k AllisonKennedy MFelix selimovd AlexisOlson Fowmy Greg_Deckler can you please help?
- AlexisOlsonSuper User
What if you add an ALLSELECTED ( KPI ) argument to your CALCULATE?
- v-jingzhangCommunity Support
Hi Anonymous
Can you provide some sample data and expected result in table format so that we can use them to test and check the measures?
You may refer to the measure structure in this thread: Rankx with filter - Microsoft Power BI Community. Filter the table provided as the first variable in RANKX() function.
Best Regards,
Community Support Team _ Jing