Forum Discussion
Limiting date range slicer
- 1 year ago
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.
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.
- Koritala1 year agoPost 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