Forum Discussion
sandee
5 years agoHelper I
RANX Function
Hi All, this might be a very silly asking this question On RANK DAX, however i am new and learning POWER Bi. please if you could you help me. I have a table and i want to give "Ranking" on ...
- 5 years ago
sandee Is this how you want it? I have attached the file below my signature.
Measure = VAR Yes = CALCULATETABLE ( Sandee, Sandee[Debt Overdue] = "yes", ALL ( Sandee ) ) VAR No = CALCULATETABLE ( Sandee, Sandee[Debt Overdue] = "no", ALL ( Sandee ) ) VAR CurrentSelection = SELECTEDVALUE ( Sandee[Debt Overdue] ) VAR Ranking = IF ( CurrentSelection = "yes", RANKX ( Yes, [Total Due],, DESC ), RANKX ( No, [Total Due],, DESC ) ) VAR Result = IF ( ISINSCOPE ( Sandee[Debt Overdue] ), Ranking ) RETURN Result
sandee
5 years agoHelper I
Hi Amit,
Many thanks for your response, here is what i am getting after applying:
sorry for late response, this is because of poor internet connection. please can you advise further as how we can get proper ranking starting from 1 to the end of clients ?
AntrikshSharma
5 years agoCommunity Champion
sandee Is this how you want it? I have attached the file below my signature.
Measure =
VAR Yes =
CALCULATETABLE ( Sandee, Sandee[Debt Overdue] = "yes", ALL ( Sandee ) )
VAR No =
CALCULATETABLE ( Sandee, Sandee[Debt Overdue] = "no", ALL ( Sandee ) )
VAR CurrentSelection =
SELECTEDVALUE ( Sandee[Debt Overdue] )
VAR Ranking =
IF (
CurrentSelection = "yes",
RANKX ( Yes, [Total Due],, DESC ),
RANKX ( No, [Total Due],, DESC )
)
VAR Result =
IF ( ISINSCOPE ( Sandee[Debt Overdue] ), Ranking )
RETURN
Result