Forum Discussion
Show/Hide Date Slicer Based on Period Selection
Hi everyone,
I’m trying to implement logic where the Date slicer is only shown when the Period slicer option “Custom” is selected.
When “Custom” is selected → the Date slicer should be enabled/visible so the user can pick a custom range.
When any of the other options (MTD, QTD, YTD, Rolling, etc.) are selected → the Date slicer should be hidden/disabled.
Here are the screenshots for context:
Date slicer: Date Slicer
Period slicer: Period Slicer
I’ve tried using DAX to detect the selected value from the Period slicer (e.g., with SELECTEDVALUE and ISFILTERED), but I can’t figure out how to apply that logic to dynamically hide or disable the Date slicer visual itself.
Is there a way to achieve this, either by conditional formatting, bookmarks, or another workaround?
Thanks a lot for any help or ideas!
Best regards,
Bojan
Please see the attached pbix.
17 Replies
- danextian
Super User
Hi BJankic
While it is possible to hide another visual witha shape by using conditional formatting, it won't be useful as you won't be able to interact with the visual underneath the shape at all. You may disable a slicer though. Create a measure to be used as a visual filter on the date slicer
Toggle = IF ( SELECTEDVALUE ( Presets[DatesPreset] ) = "Custom", 1 )Set the visual filter on Toggle to "is not blank".
- kpost
Solution Sage
conditionally displaying a visual based upon a selection in a slicer is not currently possible.
- AnonymousNot applicable
HI BJankic ,
Create a measure which gives 1 when selected value of the slicer column is Custom else gives 0. Then add this measure in filter pane of the date slicer. You can choose show items when value is - 1 in the filter as below.
- BJankic
Helper II
Hi Anonymous ,
Could you show me an example? I understand what you’re saying, but it’s not actually working — at least not on my end.
- AnonymousNot applicable
Sure. I have created a simple pbix implemeting this. First pic when I select custom. Second pic is when I select other options
- MasonMA
Super User
I hope this video may provide you with some ideas
- AnonymousNot applicable
Hi BJankic ,
I would also take a moment to thank danextian , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions