Forum Discussion
nwesterhuijs
2 years agoRegular Visitor
Calculated Column to Measure - RANKX & EARLIER
I have a calculated column, that I would like to implement as measure: Rank =
RANKX (
FILTER (
Boston_All,
EARLIER (Boston_All[Cat]) = Boston_All[Cat]
),
Bost...
- 2 years ago
nwesterhuijs
You can use the following measure:Rank = VAR __Source = ALLSELECTED( Boston_All[Index] , Boston_All[Cat] ) VAR __Result = RANK( DENSE, __Source, ORDERBY( Boston_All[Index],ASC , Boston_All[Cat], ASC ),, PARTITIONBY( Boston_All[Cat] ) ) - 1 RETURN IF( ISINSCOPE(Boston_All[Index] ) , __Result )
Fowmy
2 years agoSuper User
nwesterhuijs
You can use the following measure:
Rank =
VAR __Source = ALLSELECTED( Boston_All[Index] , Boston_All[Cat] )
VAR __Result =
RANK(
DENSE,
__Source,
ORDERBY( Boston_All[Index],ASC , Boston_All[Cat], ASC ),,
PARTITIONBY( Boston_All[Cat] )
) - 1
RETURN
IF( ISINSCOPE(Boston_All[Index] ) , __Result )