Add Action Buttons to a Report in Microsoft Power BI
Clicking buttons is a common action in most apps, and most end users know what a button means and how to use it. Designers can add buttons to a report in Microsoft Power BI to perform simple actions. For example, you can insert buttons that display additional insights into the data. Or you can add buttons that give end users quick navigation.
In this tutorial, I’ll introduce you to buttons in Microsoft Power BI by inserting two buttons in a two-page report. The button on page 1 changes to page 2 and the button on page 2 changes to page 1. Implementation is quick and easy. There are other ways to navigate from page to page, but a button is quick and obvious.
SEE: How to Create Reports in Microsoft Power BI (TechRepublic)
I’m using Power BI Desktop on a Windows 10 64-bit system, but you can also use the Power BI service. You can download the AdventureWorks Sales demonstration .pbix file from GitHub. Once downloaded, double-click the .pbix file to open it in Power BI and follow the instructions, or use your own .pbix file. If you want a quick look at the final results, check out this demo file.
How to insert a button in Power BI
Buttons in Power BI are a simple user interface control that allows the designer to create easy-to-use reports. End users typically click a button to interact in some way with the content of the report. The result is a report that works more like an app.
Inserting a button is easy. First, click the Insert tab. Then select Buttons and then select a button from the drop-down list (Figure A). As simple as that.
Figure A
That’s the easy part. If you’re familiar with Microsoft 365 Apps, you might notice that there are more “buttons” than the ordinary rectangular button you’re used to. Shapes are also available. Now let’s go ahead and create a button that has a task.
How to assign an action to a button in Power BI
Power BI reports often span multiple pages, which is a good opportunity to introduce buttons. Especially as a designer, you can add buttons that allow users to quickly navigate between pages. You could also use page and bookmark navigators for this task, but buttons are familiar to everyone and offer the user a choice of when or if they navigate to another page.
Figure B shows two pages of a simple report. We’ll add an arrow button on each side that when clicked will access the other side.
Figure B
First, let’s insert a button on page 1. Click the Insert tab. Then select Buttons and a right arrow from the drop-down list. Drag the arrow with to the top right corner of Page 1 Figure C as a guide.
Figure C
Let’s make the button a little bigger so it stands out. If necessary, expand the Format section. Then click the General menu and expand Properties. Click Lock Aspect Ratio to enable this feature and change the Height and Width properties to 100 (Figure D).
Figure D
Now that the arrow is more visible, let’s give it a navigation task. Click the button menu and expand the Action section. If necessary, activate the Action section by clicking the On/Off button. From the Type drop-down menu, select Site Navigation. Then, from the Destination drop-down menu, select Page 2 (Figure E).
Figure E
For this example, turn off the Tooltips option. However, you could add “Go to page 2” if you want. If you leave this option checked but don’t enter a message, Power BI displays a standard tooltip. Repeat the above process for Page 2, but instead use the left arrow and select Page 1 from the Target drop-down list (Figure F).
Figure F
Once published, the two buttons will function as navigation buttons.
How to publish a report to Power BI
The buttons do not work until you publish the report. So click Publish and then click Save when prompted. Then click on the published report link if it is offered. If you’re not signed in to your Microsoft account at this time, you’ll need to sign in when prompted.
Once published, users can click the right arrow on page 1 as shown in Figure Gto access page 2.
Figure G
Figure H shows the left arrow that users can click to return to Page 1.
Figure H
Why use buttons in Power BI?
You may wonder why the designer adds navigation arrows when the user can use the links in the side panel. Most importantly, this was a simple introduction to using buttons that perform actions on a published report. Second, the side panel may not be available to all users.
This demonstration is intentionally simple, but you can see how quick and easy it is to add buttons that are familiar to users. Everyone knows what a right and a left arrow mean. On the other hand, you could insert buttons that display the text “Go to page 1” and “Go to page 2”.
stay tuned
We’ve added two simple buttons to navigate between two pages, but you can use a conditional button instead. In a future article, I’ll show you how to use a button that knows what page you’re on and returns to Miscellaneous page when clicked.