Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

RANKX Column/ Measure - Rank to change dynamically when filter

Hi,

I am trying to derive dynamic rank for each department by count of department which should generate rank when filters are applied (Company Cluster, Type, Code). The summaized data looks like this,

 

DeptRankAsset Class 1Asset Class 2Asset Class 3Asset Class 4Asset Class 5Grand Total
Dept 71446594131 334
Dept 11284186058 220
Dept 12348317956 214
Dept 4478345732 201
Dept 2564873415 200
Dept 3679214632 178
Dept 9735871434 170
Dept 8858124832 150
Dept 194112354611145
Dept 510235446138144
Dept 101140176322 142
Dept 61229193439 121

 

I used both Measure and Column 

 

Measure = 

RANKX(ALL(Sheet1[Department])| CALCULATE(COUNT(Sheet1[Department]))| |DESC |Dense)
 
Column =
RANKX(Sheet1|CALCULATE(COUNT(Sheet1[Department])|ALLEXCEPT(Sheet1|Sheet1[Department]))| |DESC| Dense)
 
Measure is generating dynamic rank but I require help to create a DAX to store the value that gets ranked 1st, 2nd, etc. For Instance, 'Dept 11' should be fetched as the department coming second and this should change dynamically when the filters are applied. 
 
Column is kind off static and does not change as per the filters. 
 
Kindly provide your suggestions! Thanks! 

2 Replies