Forum Discussion

Sanskruti's avatar
Sanskruti
Helper II
3 years ago
Solved

Default date slicer

Hello,

 

I want to create a slicer which shows start date and end date. 
End date should be today's date by default and start date should be -12 months with 1st day of the month. 

For example the end date is 20/7/2023, start date should be 1/7/2023.

 

Thank you in advance.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Sanskruti ,

     

    Please create a measure:

    Measure = 
    VAR _today = TODAY()
    VAR _12_month_1st_date = EOMONTH(_today,-13) + 1
    VAR _filter = IF(MAX('Date'[Date])>=_12_month_1st_date && MAX('Date'[Date])<=_today,1)
    RETURN
    _filter

    And apply it to slicer's filter:


    Output:

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

3 Replies