Forum Discussion
Relative date filtering including future dates
- 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
You can achieve a solid+dashed appearance by stitching two measures together so that one (past data) stops where the other (future data) begins.
Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
- sridharpolina4 years agoHelper I
lbendlin I included a sample file via the link. Please let me know if that works for writing the DAX query.
- s01748042 years agoNew Member
Hi,
Unfortunately the proposed solution does not work for me as I am calculating moving/rollings averages and % change versus historical dates/averages with measures using data on dates well before the period I want to ultimately visualise.
If I apply the proposed filter on the visual, the measures are not calculated correctly or at all as none of the historical data is taken into account.
I need to differentiate between the calculation of the measures and the visualisation.
Does anyone have a work-around?
Thank you!