Forum Discussion
Power BI - Ranking on a Matrix Visual
Here is my Measure, that i wrote for Ranking.
Rank =
VAR ismfFiltered = ISINSCOPE('Customer GP Data'[New MF Code & Parent Name])
VAR isCustFiltered = ISINSCOPE('Customer GP Data'[Customer Name & Code])
RETURN
SWITCH(
TRUE(),
AND(ismfFiltered, NOT(isCustFiltered)),
IF(
COUNTROWS('Customer GP Data') > 0,
RANKX(
FILTER(
ALLSELECTED('Customer GP Data'[New MF Code & Parent Name]),
[Total Est GP] > 0
),
[Total Est GP],
,
DESC,
Dense
),
BLANK()
),
isCustFiltered,
IF(
COUNTROWS('Customer GP Data') > 0,
RANKX(
FILTER(
ALLSELECTED('Customer GP Data'[Customer Name & Code]),
[Total Est GP] > 0
),
[Total Est GP],
,
DESC,
Dense
),
BLANK()
),
BLANK()
)
Sanju_BI , have you created heirarchy for the parent and child columns ?
Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C