Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Need help filtering data using DAX & TimeSlicer,

Hello All,   I have the following User table:   Date, UserKey, Value 01/01/2019,User1,Val1 01/01/2021,User1,Val2 01/01/2022,User1,Val3 01/02/2020,User2,Val1 01/08/2021,User2,Val2 01/10/2022...
  • v-easonf-msft's avatar
    v-easonf-msft
    4 years ago

    Hi, Anonymous 

    Please try follow steps:
    1.create measue as below:

     

    lastdate = 
    VAR D1 =
        DATE ( 2021, 05, 01 )
    RETURN
        CALCULATE (
            MAX ( User[Date] ),
            FILTER ( ALLEXCEPT ( User, User[User] ), User[Date] <= D1 )
        )
    //Group by user and get max date less than or equal to current date
    visual filter = IF(SELECTEDVALUE(User[Date])=[lastdate],1,0)

     

    2.then drag  the measure 'visual filter' to the filter panle of this table visual as below:

    Best Regards,
    Community Support Team _ Eason