Forum Discussion

micjensen's avatar
micjensen
Frequent Visitor
4 years ago
Solved

Create a Next 12 month filter/Slicer function

Dear Community I'm currently struggling on how to create a date filter that consist of the next year, where starting point should be todays date. I do already have a full functional calendar with ...
  • ValtteriN's avatar
    4 years ago

    Hi,

    You can obiviously use relatiive date filtering, but I guess this is not what you are looking for.

    Here is one way to get a filter column:
    1. Add today to your calendar

     

    Today = TODAY()

    2. create helper table
    Dates Next 12Months =
    var _sdate = MAX('Calendar'[Today])
    var _edate = DATEADD('Calendar'[Today],12,MONTH) return
    DATESBETWEEN('Calendar'[Date],_sdate,_edate)
    3. Create relationship and the following column
    Filter column = IF(RELATED('Dates Next 12Months'[Date])<>BLANK(),1,0)

    I hope this helps to solve your issue and if it does consider accepting this as a solution!