Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

PriscillaCamp

How to Add a Toggle Feature to Your Power BI Report

test2.gif

 

Have you ever wanted to add a toggle feature to your Power BI Desktop Report, but don't know how? Well the good news - it is easy to do, and even better news I will show you how to 🙂 

A quick background - A toggle switch was made so users could see if the change was made successfully within the due date and the non-policy toggle was created to show if the change was successful, but not within the due date.

In my blog, I will show you how to load an image, how to create a bookmark and hide objects, and how to add an action to the buttons.

 

Terms

There are a few key terms you need to know before we get started:

Selection Pane - gives you the option to show or hide objects.

Bookmark - is like a screenshot of your current report. Creating a bookmark, gives you the ability to view it later on.

 

Select Images

Let's focus our attention to the two visualizations that we want to toggle. We will want our visualizations to look like below.

On the first visualization, we want the per policy text and the toggle button turned on.

PriscillaCamp_0-1629483335373.jpeg

On the second visualization, we want the non-policy text and the toggle button turned off.

PriscillaCamp_1-1629483383686.jpeg

Find toggle images

1. You will need to find a toggle image on a search engine of your choice. Make sure you have two images - on and off.   For example, below are the two images I used. 

PriscillaCamp_2-1629483453041.png  

PriscillaCamp_3-1629483467593.png

2. To save your images, go to your Power BI Images subfolder.

Upload your Toggle On Button

3. To upload the toggle button, go to the Insert tab.

PriscillaCamp_0-1629483686561.jpeg

4. In the Elements Group, select the Image Icon button.

PriscillaCamp_1-1629483778910.jpeg

5. A dialog box will appear to allow you to find the folder which holds your image. Go to Power BI – Images. Select it and then press the open button.

PriscillaCamp_2-1629483788108.jpeg

6. Your image appears, but most likely will need resizing.

PriscillaCamp_3-1629483812687.jpeg

7. To add verbiage, select the Text Box button.

PriscillaCamp_4-1629483833583.jpeg

8. A text box will appear. Add your verbiage and resize the text box to your liking.

PriscillaCamp_5-1629483850301.png

9. Your image should look like below. The toggle button is on along with the Per Policy text.

PriscillaCamp_6-1629483868372.jpeg

Upload your Toggle Off Button

10. To upload the toggle button, go to the Insert tab.

PriscillaCamp_7-1629483904132.jpeg

11. In the Elements Group, select the Image button.

PriscillaCamp_8-1629483919627.jpeg

12. A dialog box will appear to allow you to find the folder which holds your image. Go to Power BI – Images. Select it and then press the open button.

PriscillaCamp_9-1629483938096.jpeg

13. Again, your image will need resizing.

PriscillaCamp_10-1629483951567.jpeg

14. Go to the Insert tab, and select the Text Box button.

PriscillaCamp_11-1629483965825.jpeg

15. A text box will appear. Add your verbiage and resize the text box to your liking.

PriscillaCamp_12-1629483985245.jpeg

Create Bookmarks and Hide Objects
Toggle On

16. Select the View tab.

PriscillaCamp_13-1629484015215.jpeg

17. Select Bookmarks and Selection buttons.

PriscillaCamp_14-1629484030124.jpeg

18. To your right, you will see the selection and bookmark pane. The bookmark pane will be used to add two screenshots. One for the “toggle on” view and the other for the “toggle off” view.

PriscillaCamp_15-1629484045025.jpeg

19. In the Selection Pane, you can rename, show or hide your objects.

PriscillaCamp_16-1629484062757.jpeg

20. To rename, double click the relevant object and a white box appears. I recommend giving objects a relevant name so they can be easily recognized when hiding or unhiding your objects.

PriscillaCamp_17-1629484079446.jpeg

21. Hide the non-policy and toggle button off objects by selecting the eye icon.

*For this visualization, I also hid the visibility of “Overall Change Success% Non-Policy” and “Unsuccessful Changes non-policy” objects.

PriscillaCamp_18-1629484095304.png

22. After you have finished the selection, we can now move on to the Bookmarks Pane.

PriscillaCamp_19-1629484115634.jpeg

23. In the Bookmarks pane, click the Add button, and then rename the bookmark to Per Policy.

PriscillaCamp_20-1629484129101.jpeg

Toggle Off

24. In the selection pane, hide the “Per Policy Text” and “Toggle Button On” objects.

PriscillaCamp_21-1629484150570.jpeg

25. Show the objects Non-Policy and Toggle Button off.

PriscillaCamp_22-1629484164768.jpeg

26. Select the Add button.

PriscillaCamp_23-1629484181421.jpeg

27. Name your new bookmark “Non-Policy”.

PriscillaCamp_24-1629484194846.jpeg

Add an Action
Toggle On

28. Select the Per Policy bookmark

PriscillaCamp_25-1629484230000.jpeg

29. Select the “Toggle Button” on image.

PriscillaCamp_26-1629484242021.jpeg

30. The format button pane will appear.

PriscillaCamp_27-1629484256892.jpeg

31. Go to the Action and expand the section.

PriscillaCamp_28-1629484274065.jpeg

32. In the Action section, go to Type and verify bookmark is selected.

PriscillaCamp_29-1629484288206.jpeg

33. In the Action section, go to Bookmark and select Non-Policy. When the toggle button is on, and your user clicks it the button will need to go to the Non-Policy bookmark.

PriscillaCamp_30-1629484300139.jpeg

Toggle Off

34. Go back to the Bookmarks Pane, and select the Bookmark “Non-Policy”

PriscillaCamp_31-1629484321033.jpeg

35. Select the toggle off button.

PriscillaCamp_32-1629484345017.jpeg

36. The Toggle Off Button’s Format Pane appears.

PriscillaCamp_33-1629484380714.jpeg

37. Go to the Action Section and Maximize the section

PriscillaCamp_34-1629484396160.jpeg

38. In the Action section, go to Type and verify bookmark is selected.

PriscillaCamp_35-1629484412151.jpeg

39. In the Action section, go to Bookmark and select Policy. When the toggle button is off, and your user clicks it the button will need to go to the Policy bookmark.

PriscillaCamp_36-1629484423262.png

Conclusion
We selected an image to create our toggle button, then we used the selection pane to show/hide relevant objects. Next, we created bookmarks to take a screenshot of our pages, and last we setup actions to have the toggle switch between pages when selected.

Congratulations! You now have a toggle button that you can switch on or off! Have fun using your new skills!

About Me

Thank you for reading my blog.

To learn about more about me, you can visit my page or connect on Social Media:

Home - IT Data Diva

Priscilla (Marotte) Camp | LinkedIn

https://twitter.com/ITDataDiva

 

 

 

 

 

 

 

 

Comments