Power BI: How to Create Dynamic Show Hide Slicer Panel
Tags: powerbi, dataanalysis, tutorial, beginners
Published: 2024-03-07 06:00:00

## **Introduction:**

Optimizing space and enhancing usability are vital aspects of designing Power BI dashboards. In this article, we'll explore a versatile technique for creating a Dynamic Show Hide Slicer Panel in Power BI. This technique allows users to switch the visibility of slicer panels as needed, optimizing space and improving dashboard usability. By leveraging Power BI features such as shapes, bookmarks, and buttons, we'll demonstrate how to empower users to dynamically show or hide slicer panels, ensuring a streamlined and user-friendly dashboard experience.

## **Step-by-Step Guide:**

### **1. Start by Creating a Rectangular Shape and Positioning Filters:**

Start by creating a rectangular shape (Insert - Shapes) and positioning two filters above it in the dashboard canvas (make sure Product Slicer and Country Slicer are above on the Shape in Selection panel). and then Group these three elements together to simplify management (select all of them and press Ctrl+G).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tv7cunfrc3jnt14uta0v.png)

### **2. Create Buttons and Bookmarks:**

Next, add two buttons to the dashboard and label them as "Show Filter" and "Hide Filter" respectively. These buttons will serve as triggers to control the visibility of the navigation panel.

Now, create two bookmarks—one for showing the filter panel and another for hiding it. Open the bookmarks panel to rename and rename them accordingly.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/etmyxgphj7oz5v0nhu3d.png)

### **3. Update Bookmark:**

Select the filter group and disable the data option and choose the `Selected visuals` option. This ensures that only the selected visual (i.e., the filter group) will be displayed when the bookmark is applied, and then `Update` the "Show Filter" bookmark.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lev593rwp2hc8d5eo17g.png)



Similarly, update the "Hide Filter" bookmark by making the filter group invisible. Disable the data option and choose the Selected visuals option and then Update the Bookmark.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dnf8s9f8p0gneozcba5.png)

### 4. **Set Button Actions:**

Configure the actions for the "Show Filter" and "Hide Filter" buttons. In the format panel, open the action settings and set the type to `Bookmark`. 

Assign the corresponding bookmarks to each button—set "Show Filter" bookmark for the "Show Filter" button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u2b244v6fqi8pb1dn9lr.png)


and set "Hide Filter" bookmark for the "Hide Filter" button.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r4q15fzv2jc94x1vlv31.png)

## **Conclusion**

The Dynamic Show Hide Slicer Panel technique offers a straightforward solution for managing space constraints and improving dashboard usability in Power BI. By enabling users to switch the visibility of slicer panels based on their preferences, this approach enhances user control and flexibility. Whether it's showing or hiding slicer panels dynamically, this technique empowers users to optimize space utilization and create a streamlined dashboard interface for efficient data exploration and analysis.

---

## Explore more

{% embed https://dev.to/luca1iu %}


Thank you for taking the time to explore data-related insights with me. I appreciate your engagement.

{% cta https://www.linkedin.com/in/lucaliu-data %} 🚀 Connect with me on LinkedIn {% endcta %}

{% cta https://twitter.com/Luca_DataTeam %} 🎃 Connect with me on X {% endcta %}


{% cta https://www.instagram.com/luca1iu?igsh=MmJneDFpdjNtYWU1&utm_source=qr %} 🌍 Connect with me on Instagram {% endcta %}