Primarily in the Power Bi desktop, we will create the first visual. In this example, we have used a dataset which is displaying the cost information about the projects in the Government domain. It is a normal ‘Donut Chart’.
On a different page, we will create the next visual that we want to toggle to. Here we have used a ‘Stacked column chart’ to display the information about the projects under the government.
Insert two images of the left toggle button and right toggle button and adjust their alignment in such a way that they are exactly placed over one another. Here is what we will do -> in the general setting; we can adjust the X position, Y position, Width and Height.
Now, we will bring both the visuals to the same page and delete the redundant page.
In this step, we have to go to the navigation bar to view and tick the ‘Bookmarks Pane’ and ‘Selection Pane’.
In the Bookmarks tab, we are going to create two bookmarks by adding the bookmarks. Here in this example, we have added two bookmarks named ‘Donut_Chart’ and ‘Bar_Chart’.
Now, we will select the image and visual that we want to hide for the first bookmark by using the hide icon on the selection pane.
After selecting the appropriate visuals and images for the appropriate bookmark, we have to click ‘Update’ for the desired bookmark.
Again we will select the appropriate visuals and images for the other bookmark and click update for that bookmark.
After updating the bookmark we will click the image of the toggle button and in the format section enable the ‘Action’ tab.
After enabling the action tab, we are going to select the ‘Type’ as Bookmark and select the Bookmark that the toggle button should point to. Here is our example, the first image would point to the Bar_Chart bookmark.
Similarly, for the second image, the type will remain the same and the bookmark will be the other one. In this example, the second image will point to ‘Donut_Chart’ bookmark.
After completing these steps we will press and hold Ctrl and click on the image and the visual should toggle to the next visual.