Forum Discussion
Need help filtering data using DAX & TimeSlicer,
- 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 datevisual 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
To clarify the criteria.
This is a table with historical data.
When you made calculation base on the table, you set a date [dt1] somewhere in the past.
The line to apply then for each user is the first one older to [dt1].
So if I come back to my example, with a [dt1] set to 5/1/2021, you will keep in final result only those lines:
01/01/2021,User1,Val2
01/02/2020,User2,Val1
01/04/2021,User3,Val2
Hopes it make it clearer like this.
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 datevisual 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
- Anonymous4 years agoNot applicable
Hello,
Sorry for the delay in my response, was on another stuff last weeks.
I test your solution today, it works great.
Exactly what I need.
Thanks a lot,Laurent.