Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Relative date filtering, need last 3 years PLUS YTD.

I am trying to filter my data for my reports.  I need the last full 3 years plus this YTD.  Today is May 4, 2018.  So I would want to see 1/1/2014 - 5/4/2018.
  • dbhudia's avatar
    dbhudia
    5 years ago

    I know this is an old thread but putting this on anyways. 

    This 'Should' be something relative date could do but sadly doesn't. I created a calculated field on my date table called YearIndex

    So the current year is 0 and the prior year is -1. Now you can just use the basic filter to get Current Year and Last year or however many years you want. 

    YearIndex =
       VAR ThisYear = YEAR(NOW())
       RETURN
       Dates[Year] - ThisYear