Forum Discussion
Salle
3 years agoAdvocate I
Strange RANKX sorting
Simple setup with Table "Result" Column "Size" (decimal formatted), slicer ("Sample Name" from Table2 Parameter). 1 to many relationship setup between Parameter and Result table. Rank S...
- Anonymous3 years ago
Hi Salle ,
I suggest you to try code as below to create a measure.
Rank Size = VAR _SIZE = CALCULATETABLE ( VALUES ( Result[Size] ), ALLSELECTED ( Result ) ) VAR _ADDRANK = ADDCOLUMNS ( _SIZE, "RANK", RANKX ( _SIZE, [Size],, ASC, DENSE ) ) RETURN SUMX ( FILTER ( _ADDRANK, [Size] = MAX ( Result[Size] ) ), [RANK] )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi Salle ,
I suggest you to try code as below to create a measure.
Rank Size =
VAR _SIZE =
CALCULATETABLE ( VALUES ( Result[Size] ), ALLSELECTED ( Result ) )
VAR _ADDRANK =
ADDCOLUMNS ( _SIZE, "RANK", RANKX ( _SIZE, [Size],, ASC, DENSE ) )
RETURN
SUMX ( FILTER ( _ADDRANK, [Size] = MAX ( Result[Size] ) ), [RANK] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.