Forum Discussion
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.
- Anonymous3 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 _filterAnd apply it to slicer's filter:
Output:Best Regards,
Gao
Community Support TeamIf 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
- IdrissshatilaSuper User
Hello Sanskruti ,
Refer to this solution https://community.fabric.microsoft.com/t5/Desktop/Custom-default-date-on-date-range-slicer/m-p/2463091
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- AnonymousNot applicable
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 _filterAnd apply it to slicer's filter:
Output:Best Regards,
Gao
Community Support TeamIf 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