Forum Discussion
Anonymous
3 years agoNot applicable
Filtering with dates
Hi, I'm new to DAX queries and trying to use the below code although I keep getting an error. I want to filter based on the last 2 years of data based on todays date. My Date_Rd column is in...
rubayatyasmin
Community Champion
3 years agohi, Anonymous
you can also use Now() instead of Today(). But ofcourse what ChielFaber suggested you can also use DATEDIFF to determine date differences. Here is the example code for you,
EVALUATE
FILTER(
'values',
DATEVALUE('values'[Date_Rd]) >= DATE(YEAR(NOW()) - 2, MONTH(NOW()), DAY(NOW()))
)
it should solve your issues for now. Also, please add the error message of screen shot here as well.