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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
j1s
Helper I
Helper I

Button to toggle visual axis Count vs Count (Distinct)

Is there a way to add a button to a visual page to make the axes for the visuals on the page (stacked bars in my case) switch between Count and Distinct Count?

 

j1s_0-1708606778435.png

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@j1s Yes, you can create 2 visuals and 2 buttons and stack them. Create 2 bookmarks using the Bookmarks pane along with the Selection pane to toggle between the visuals and buttons. Tie these bookmarks to the buttons.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @j1s

 

@Greg_Deckler Thank you for sharing!

 

Yes, you can achieve your goals by creating bookmarks and buttons.

 

Here are the details, please try:

 

 First, you need to create two versions of your stacked bar visual - one using Count and the other using Distinct Count. Ensure these are placed exactly on top of each other on your report page.

 

Next, create two bookmarks in Power BI - one for each visual state (Count and Distinct Count). Make sure to hide one visual and show the other for each bookmark accordingly.

 

vnuocmsft_0-1708677672340.png

 

Finally, insert a button on your report page that users can click to toggle between the two bookmarks (and thus, between Count and Distinct Count).

 

vnuocmsft_1-1708677769392.png

 

vnuocmsft_3-1708677960696.png

 

vnuocmsft_2-1708677860450.png

 

By following these steps, you'll effectively create a toggle mechanism on your report page, allowing users to switch the visual's axis between Count and Distinct Count with a simple click.

 

You can view the link below for more details:

 

Create report bookmarks in Power BI to share insights and build stories - Power BI | Microsoft Learn

 

Create buttons in Power BI reports - Power BI | Microsoft Learn

 

Regards, 

Nono Chen 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

Thanks, any reason you're not advocating using the bookmark navigator button option, rather than creating and configuring normal buttons?

Greg_Deckler
Community Champion
Community Champion

@j1s Yes, you can create 2 visuals and 2 buttons and stack them. Create 2 bookmarks using the Bookmarks pane along with the Selection pane to toggle between the visuals and buttons. Tie these bookmarks to the buttons.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.