How to switch your charts in Power BI with buttons


For one of my first Power BI reports I learned how to change my charts with the help of buttons. This is particularly useful if you want to enable the user to dynamically change a visualisation in the report. But how can this be done? I would like to answer this question with this blog post. The data I use as an example is mock data.

We start by connecting our data with Power BI and building two different charts, As soon as this is done we can start to go trough the following steps:

Step 1:

Put the charts over eachother. Like this:


Step 2

Click on "Insert" on the upper left corner of Power BI. Afterwards click on buttons and then choose “Blank”.


As soon as this is done a square appears. If you click on it a visualisation menu will appear on the right-hand side. There you can insert a button text/titel by activating the title-option in the "Style" menu.

Repeat this process for the second button.

Step 3

Next we click on "View" on the upper menu of Power BI and choose bookmarks and selection.

Hide one of the charts trough hiding in the selction menu.

Then click on “ADD” to create a new bookmark in the bookmark section and change the name accordingly. For me it would be “Top10”

Repeat the progress for the other chart.

💡
Important: If you work with filter than you have to adapt the bookmarks to not reset the filtering everytime you change the chart. To do that you do a right click on one of the bookmarks and click on data so that the hook before the word is removed.


Step 4

Now everything is set up and we go on to enable the interactivity. For this you just have to click on one of the buttons and go to the format section. There you have to activate the “Action”. In this section you choose “Bookmark” for typ and then the bookmark you want to connect this particular button with. In my case it would be the Top10 button with the bar chart.

Repeat the progress for the second button.

Step 5

While you still work in the Power BI file on your laptop you have to press the key [Str] while you click on the buttons. Then it should change accordingly as you can see here:

Author:
Maria Maske
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab