Forum Discussion
Limiting date range slicer
Hi, I have a date range slicer and user always want to restrict start and end date selection for the last 90 days only. Slicer sholud not allow to select dates more than 90 days. The 90 days could be history dates as well. At the end, anywhere date range slicer should allow the dates with in 90 days.
Appreciate if anyone can share sample pbxi or code
Thanks,
Sri
Hi Koritala,
Thank you for reaching out to the Microsoft fabric community forum. I reproduced the scenario again, and it worked on my end. I used my sample data and successfully implemented it.
I am also including .pbix file for your better understanding, please have a look into it:
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
11 Replies
- KoritalaPost Patron
Hi Wardy,
Thanks for your response.
I don't want to apply filter at visual level.
Regards,
Sri
- v-kpoloju-msftCommunity Support
Hi Koritala,
Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to MohamedFowzan1, wardy912, for those inputs on this thread. I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.
I am also including .pbix file for your better understanding, please have a look into it:
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
Thank you for using the Microsoft Community Forum.- KoritalaPost Patron
Hi kpoloju,
In continuation to previous ask, user asking set the report filter default to MTD , after that if they want to set 90 days restriction.
Along with above 2 filter scenarios, we have to provide year and month slicer to go back to select previous year and months. All in one single report,how can we achieve?
Thanks
Sri
- v-kpoloju-msftCommunity Support
Hi Koritala,
Thank you for reaching out to the Microsoft fabric community forum. I reproduced the scenario again, and it worked on my end. I used my sample data and successfully implemented it.
I am also including .pbix file for your better understanding, please have a look into it:
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
- KoritalaPost Patron
Working fine.
- MohamedFowzan1Super User
Hi Koritala
- Two Slicers Approach – Use separate From and To date slicers from your Date table instead of a single range slicer.
- DAX to Enforce Limit – Create a measure to capture the selected From date and restrict the To date to within 90 days using a filter.
Create a measure for the minimum selected "From" date:
FromDate = MINX(ALLSELECTED('Calendar'[Date]), 'Calendar'[Date])
Create a measure that checks if the "To" date is within 90 days of the "From" date:
Measure = IF(
MAX('Calendar'[Date]) >= [FromDate] && MAX('Calendar'[Date]) <= [FromDate] + 90,
1,
0
)Apply this measure as a filter on the "To" date slicer visual, setting the filter to show only values where the measure equals 1. This restricts the selectable "To" dates to a maximum of 90 days after the selected "From" date.
- KoritalaPost Patron
Hi Mohamed,
Thanks for your response. Is this possible with single range slicer instead of 2 drop down slicers. Because user has to scroll to go back to choose previous dates it will be bit hard.
Thanks for your solution.
Regards,
Sri