Forum Discussion
lucadelicio
6 months agoImpactful Individual
Dynamically Enable and Disable Date Dropdown
I’m trying to disable a date hierarchy dropdown slicer based on the selection of another dropdown slicer. I’ve already received great help from danextian , whom I’m tagging again in case they can he...
RicardoTraNa
6 months agoResponsive Resident
Hi there! in Power BI, there’s no built-in way to truly “disable” a slicer or automatically clear its selection based on another slicer. That’s why you see the previous values or “All” showing up.
The closest way to get the behavior you want is to make the date slicer effectively ignored when the period selected isn’t “Custom.” Here’s how:
- Detect the “Custom” selection with a measure
IsCustom = IF(SELECTEDVALUE(Period[Type]) = "Custom", TRUE(), FALSE()- Adjust your calculations so the date slicer only affects results when IsCustom is TRUE:
FilteredMeasure =
CALCULATE(
[YourMeasure],
IF(
[IsCustom],
ALLSELECTED(Date), -- slicer applies
ALL(Date) -- slicer ignored
)
)
- (Optional) Show a message on a card to let users know the date filter isn’t active:
DateMessage = IF([IsCustom], "", "Date filter does not apply for this period"This way:
If “Custom” is selected → date slicer works normally.
If another period is selected → slicer is ignored, and the user sees consistent results.
Hope that help!!!