0845 643 64 63

How to create a toggle button in Power BI

In this blog post I will be showing you how to use a toggle button in Power BI. A toggle button in Power BI allows users to quickly switch between two options.

Our first step is to create a toggle button as Power BI doesn’t have one by default. You can import one but by creating it yourself, it gives you more control.

Our toggle button is created by having two images of identical size over the top of each other and using bookmarks to flip between the two. Therefore, you can create your images using any software you like. I’ll be using PowerPoint and importing shapes.

In PowerPoint, import the Flowchart: Terminator shape.

Then, import an oval and shape it into a circle. Change the shape fill to white or grey and move the circle so that it fits inside the curve of the curved rectangle.

Once that is done, copy and paste the shapes that form the toggle button and move the white circle to the other side of the curved rectangle. Next, import a textbox over the shapes and include the text you would like for the toggles.

My Power BI report is going to toggle world record times between Men and Women, so my toggles look like this:

It is crucial that these images are the same size, therefore we need to make sure there is no whitespace around the toggle images. To ensure this. I copy the two images into everyone’s favourite image editor – Microsoft Paint! There, crop all the whitespace around the shapes before saving the images as .png files.

It is now time to import these two created images into Power BI and align them such that they’re directly on top of each other. This is required because the image’s visibility will be toggled to give the impression it’s one button instead of two images. You can ensure the images are exactly aligned using the position and size properties.

Toggling the visibility of the images and associated charts is done using bookmarks. The below screenshot shows for the Women’s bookmark: all men related items are hidden and all women related items are shown.

The final step is to action the images such that when clicked on, the bookmark is activated and toggles to the other image and charts. When the women’s toggle is clicked activate the men’s bookmark.

Hopefully you should end up with something like this:

Clicking on the toggle in the top right corner toggles us to the women’s chart.

Clicking on the toggle in the top right corner again takes us back to the men’s chart.

This is my 2nd blog post that uses PowerPoint to enhance my Power BI experience, please see the first blog post here: https://www.purplefrogsystems.com/blog/2019/12/creating-power-bi-layouts-using-powerpoint/

One comment on “How to create a toggle button in Power BI

  1. Kunal Gaikwad on said:

    What an amazing post! I always look forward to reading your posts.
    They are so engrossing and well-written. The way you consider your readers’ preferences and leave a hint of personally relatable experiences is simply exceptional. There are always a few lines in your posts that stick with me and keep me hooked on your writing. Reading one of your blogs immediately makes visitors want to read another and share it. This post was wonderful, and please continue to share such blogs in the future.

    I believe that my expertise in the field in which you write will be very beneficial to you. You can get a sense of my writing style by browsing through my high-quality content.

Leave a Reply

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

*

371,433 Spambots Blocked by Simple Comments

HTML tags are not allowed.

Power BI Sentinel
The Frog Blog

Team Purple Frog specialise in designing and implementing Microsoft Data Analytics solutions, including Data Warehouses, Cubes, SQL Server, SSIS, ADF, SSAS, Power BI, MDX, DAX, Machine Learning and more.

This is a collection of thoughts, ramblings and ideas that we think would be useful to share.

Authors:

Alex Whittles
(MVP)
Jeet Kainth
Jon Fletcher
Nick Edwards
Joe Billingham
Lewis Prince
Reiss McSporran
Microsoft Gold Partner

Data Platform MVP

Power BI Sentinel
Frog Blog Out
twitter
rssicon