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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.