Forum Discussion
Creating a custom visual - a slicer which can dynamically be hidden
Thank you very much Daniel. This helps a lot.
Do I understand correctly that it might be possible to develop a custom visual in which you can add conditional formatting such that it becomes invisible dynamically, but it is not possible to actually deactive the slicer. Such that it would still affect (filter) the data on the page?
Do you think a combination of creating a custom visual with conditional formatting
and using the option to hide the items in the slicers (see screenshot below). Would be feasible? Or would it then still be "active" in the background?
Thank you!
This is a good point. If you were to have a conditional property that determines whether the slicer content is visible, you should probably actively remove the applied filter in your visual logic. You would need to save this in your visual's persistence so that if/when the condition is displayed, it gets triggered, then the visual can re-apply the filter. The only problem with this is if you wish to sync slicers across pages - due to security restrictions, they can only share the active filter between slicer instances and no other persisted properties. I'm unsure if this will be an issue for you, but you will need to think about and test it quite heavily.
Regarding your second question, yes, the visual will always be on the canvas, as there's no way to explicitly hide it from Power BI outside of manually hiding it in the selection pane or using bookmarks.
Regards,
Daniel