Forum Discussion
RANKX Help
That did not work. I'm trying the following Measure but it only works if Manager is not in the visualization.
Measure = IF(ISINSCOPE(MyTable[Manager]),RANKX(ALLSELECTED(MyTable),CALCULATE(DISTINCTCOUNT(MyTable[INCIDENTID])),,DESC,DENSE),RANKX(ALLSELECTED(MyTable[Person]),CALCULATE(DISTINCTCOUNT(MyTable[INCIDENTID])),,DESC,DENSE))
Found another solution that is close but the rank numbers are off, especially if Manager is empty:
Measure 3 =
Var summry = SUMMARIZE(ALLSELECTED(MyTable),[Person],"DistCount",DISTINCTCOUNT(MyTable[INCIDENTID]))
var tmp = ADDCOLUMNS(summry,"RNK", RANKX(summry,[DistCount],,DESC,DENSE))
return
MAXX(FILTER(tmp,[Person]=SELECTEDVALUE(MyTable[Person])),[RNK])
Gives the following output. The second row should be rank 2 and the first row should be rank 1. I've blocked out any preson information. Columns are Person, manager, distinct count of IDs then 3 measure I'm trying for rank. Last column is the measure above.
- v-kelly-msft6 years agoCommunity Support
Hi TCavins ,
Try to create a calculated column as below:
Column = VAR summry = SUMMARIZE ( ALLSELECTED ( MyTable ), [Person], "DistCount", DISTINCTCOUNT ( MyTable[INCIDENTID] ) ) RETURN RANKX ( summry, [DistCount],, DESC, DENSE )Best Regards,
Kelly- TCavins6 years agoHelper V
This isn't working for me.