Toggle Between Charts in Power BI

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. 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 for the button:

Similarly, I created a second button for Attribute:

Now starts our real work from here. 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 to go through bookmarks creation: https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks

Once we create bookmarks, we get the following: 

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. Now define actions for the buttons. Shown below for Region button: (Do same for Attribute button)

Now we need to achieve 2 things:

  1. When I click on Region button, following actions should take place:
  • Transaction Value by Region chart
  • b. Attribute button (this will help us in switching to Attribute based chart)
  • c. HIDE Transaction Value by Attribute chart
  • d. HIDE Region button

2.  When I click on Attribute button, following actions should take place:

  • a. Transaction Value by Attribute chart
  • b. Region button
  • c. HIDE Transaction Value by Region chart
  • d. HIDE Attribute button

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 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 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 side by side, let us place them in such a way that they are above each-other and completely cover each other up.

  1. Transaction Value by Attribute chart and Region button should be together.
  2. Transaction Value by Region chart and Attribute button should be together.

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:

Now completely placing them on one another, I get the following:

  • Region button is placed below Attribute button
  • Transaction by Attribute chart is placed below Transaction by Region chart

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 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. Don’t forget to leave your comments.

Pragati

Leave a Reply

Your email address will not be published. Required fields are marked *