Change Visual by click of a button.
High level resolution steps
- I have to show visual on click of respective button that is Sales by sub-category on Click of “SubCategory” button and Profit of Region on click of “Region” button.
Detailed resolution steps
Step 1: In Power Bi “MainPage” I have two visual representations based on Sub-Category and Region.In First Visual I used Clustered Bar Chart and shown the Sales by Sub-Category. And in Second visual I used Pie Chart and shown Profit by Region.
Add two buttons one for showing Sub-Category visual and other one for showing Region
visual.
![Power BI bookmarks and selection pane setup.](https://sainacloud.com/wp-content/uploads/2024/08/image-46.png)
Step 2: Now open View ribbon bar and in that select Bookmarks and Selection pane.
![Selection pane with visuals disabled for Profit by Region and Sales by Sub-Category.](https://sainacloud.com/wp-content/uploads/2024/08/image-47.png)
Step 3: In starting it will show no visual as per below image. For that in “Selection” pane disabled the Profit by Region and Sales by Sub-Category visual and click on Add in “Bookmarks” pane as show in the below image.
![Adding a bookmark for the Sales by Sub-Category visual.](https://sainacloud.com/wp-content/uploads/2024/08/image-48.png)
Step 4: Now same as step 3 first we should “enable” Sales by Sub-Category visual and in “Bookmarks”
pane click on Add and rename as Sub-Category.
![](https://sainacloud.com/wp-content/uploads/2024/08/image-49.png)
Step 5: For showing Profit by Region visual “disable” the “Sales by Sub-category” and “enable” the “Profit by Region” in selection pane and bookmark that and rename as Region.
![](https://sainacloud.com/wp-content/uploads/2024/08/image-50.png)
Step 6: Add action for both the buttons, we need to select both button one by one and enable the
action option.
For showing “Sales by Sub-Category”:-
Type : Bookmark
Bookmark : Sub-Category
![](https://sainacloud.com/wp-content/uploads/2024/08/image-51.png)
For showing “Profit by Region”:
Type : Bookmark
Bookmark : Region
![](https://sainacloud.com/wp-content/uploads/2024/08/image-52.png)
Output:
![](https://sainacloud.com/wp-content/uploads/2024/08/image-53.png)
![](https://sainacloud.com/wp-content/uploads/2024/06/MicrosoftTeams-image-1-2.jpg)
Saumya Anilkumar
Technical Consultant – Interested in creating stunning Power BI dashboards and interest towards Power Apps applications.