Forum Discussion
Creating a custom visual - a slicer which can dynamically be hidden
Hi Anonymous,
The visibility of a visual itself can only currently be controlled from the selection pane and bookmarks. Ideally, we need a generic property on the visual container that governs visibility based on a measure. This would then affect all visuals in Power BI without any work needed by third-party developers.
If you create a custom visual, you could probably have a property that uses conditional formatting. Still, the best you could do is hide the DOM components from the user rather than the visual itself. However, the visual container would still be present on the canvas and actively running queries for the normally displayed data despite not having any visible components. This isn't something you can easily control, as the visibility of a visual container governs whether it executes a query or not. If a visual is visible, then Power BI will push data to it. There are no custom visual APIs to prevent data loading.
If you can accept these limitations, it could be a possible approach to do what you're looking to do.
Regards,
Daniel