Forum Discussion
matsahiro
Helper II
5 years agoLast 12 Complete Month Rolling Filter
Hello, I have a visual where I would like to display only data for the last 12 complete months. For example, if today is 5/12/2021, the data I would like to be displayed would be running from 4/1/202...
Fowmy
Super User
5 years agomatsahiro
Please use the following formula to have the desired results:
Rolling 12 Month Ind =
VAR CurrentDate = SELECTEDVALUE(Sales[Date_Sold])
VAR Start_Date =
EOMONTH( TODAY() , -14 )+1
VAR End_Date =
EOMONTH ( TODAY(), -1 )
RETURN
IF ( CurrentDate >= Start_Date && CurrentDate <= End_Date, 1, 0 )
Fowmy
Super User
5 years ago- matsahiro5 years ago
Helper II
Definitely gave it a go. The IF statement ended up not working for a specific visual I had, but I simply threw in the same logic in a CALCULATE statement.
Rolling 12 Month Count =VAR Start_Date = EOMONTH(TODAY(), -14)+1VAR End_Date = TODAY()RETURNCALCULATE(COUNT(Table[Column]), Table[Column] >= Start_Date && Table[Date] <= End_Date)Thank you very much for the help!