Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Let us consider a scenario where we need to represent similar information at two different category levels.
One potential and easiest way would be to create 2 charts or 2 visuals representing same metric at different levels. Like the one shown below:
In the above charts, I am displaying total transaction value by Region and by Attribute on 2 different charts.
Now suppose on the reporting tab, I have multiple visuals and I do not have enough space for these 2 charts. What should I do in such scenario, where client requirement still stands at having 2 separate charts?
Here we start to talk about Bookmarks and how we can use them to toggle or switch between 2 charts.
Let us start by creating 2 buttons in Power BI. Go to Insert --> Buttons --> Blank
I am using blank buttons for now. We can change the text or label for the button as shown below:
Similarly, I created a second button for Attribute:
Now starts our real work.
Go to View option on the top ribbon and click on Bookmarks. You will see a bookmarks pane on the right as highlighted below:
Now we will create 2 bookmarks for the 2 buttons that we have got.
Under Bookmarks Pane, click Add and you can create bookmarks. Following link can be referred for bookmarks creation: https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks
Once we create the bookmarks, we get the following as shown below:
Go to the top ribbon again: View --> Selection
We get a Selection pane on the right. If you see in this section, we have got all the visuals and buttons that we have created so far on our reporting tab. For ore details on Selection Pane, refer following link: https://www.c-sharpcorner.com/article/new-power-bi-featu-selection-pane-in-power-bi-preview-feature/
Now we will define actions for the buttons. The screesnhot shown below is for the Region button: (Do the same for the Attribute button)
Now we need to achieve following things:
Now go to Selection Pane on the right --> Hide Attribute button, Hide Transaction Value by Region chart; under Bookmarks Pane UPDATE the Attribute button.
We are basically creating an action for the Attribute button here. When this button is clicked, it should show us Transaction by Attribute chart and Region button, so that we have an option to switch back to Regional chart.
Similarly, we do the same settings for the Region button as shown below:
Now let us see how this is working in the report view. (Use Ctrl+Click in Power BI Desktop to click on a button)
Just to clean the visualisations, rather than having them side by side, let us place them in such a way that they are above each-other and completely cover each other up.
Just see the below image to make this clear – how I am trying to place these visuals and buttons on the top of each-other. This is in a way just taking up space for one single visual but in reality having 2 charts:
Now completely laying them over one another, I get the following:
Now let us see the completed functionality in a single frame:
So, when we click on Region button, we see chart related to region and Attribute button.
In case we need to switch back to Attribute related chart, same works for the Attribute button as well.
This is how we can toggle/switch between charts in Power BI, using Bookmarks and Buttons functionality.
Hopefully, this article helps everyone out there.
Pragati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.