Forum Discussion
sridharpolina
4 years agoHelper I
Relative date filtering including future dates
Hi, I am trying to dynamically filter a date which includes future dates as well. For Ex. For March 2022 I need a query which looks at the previous 12 months and the next 12 months (March2021-March20...
- 4 years ago
You could add a column to your date table for filtering purposes, something like
Within 24 month window = var startDate = EOMONTH( TODAY(), -13) + 1 var endDate = EOMONTH( TODAY(), 12 ) return IF( 'Date'[Date] >= startDate && 'Date'[Date] <= endDate, 1, 0)then add that filter to your visuals
johnt75
4 years agoSuper User
You could add a column to your date table for filtering purposes, something like
Within 24 month window =
var startDate = EOMONTH( TODAY(), -13) + 1
var endDate = EOMONTH( TODAY(), 12 )
return IF( 'Date'[Date] >= startDate && 'Date'[Date] <= endDate, 1, 0)then add that filter to your visuals
- mayasandler3 years agoRegular Visitor
I was facing a similar issue and couldn't find a solution. Your suggestion is a great workaround. Thanks!