Forum Discussion

Peter_'s avatar
Peter_
Resolver I
7 years ago
Solved

Filter on Date Rank Measure

Hi,

 

I'm trying to create measures which give me 1st, 2nd, 3rd date labels from the latest available date going back and it should depend on dates selected in a date range slicer. This works for the 1st label, i.e. when a date rank below is 1, but not for the others. Is there anything obviously wrong with the DAX expressions I'm using?

 

Date Rank measure

Date Rank =
RANKX( ALLSELECTED(Table[Aggregation Date]), CALCULATE(MAX(Table[Aggregation Date])), , DESC)
 
Date Label measures
[Date[Rank 1]] Label] = "as of " & UNICHAR(10) & CALCULATE(MAX(Table[Aggregation Date]), FILTER(Table, Table[Date Rank] = 1))
[Date[Rank 2]] Label] = "as of " & UNICHAR(10) & CALCULATE(MAX(Table[Aggregation Date]), FILTER(Table, Table[Date Rank] = 2))
 
Putting this into I table where there are two dates {11/17, 11/20} I get following:
 
 
Setting the end of slicer to exclude 11/20, Date[Rank 1] Label updates to 11/17 as expected
 
 
 

1 Reply