top of page

How to Create a Toggle Button in Tableau

hands typing on a laptop

What is a Toggle Button?

Toggle buttons are UI controls that let users switch a setting between two states - typically ON/OFF, Show/Hide, Start/Stop or Enable/Disable - with a single tap or click. They provide immediate visual feedback by changing appearance when activated, making them ideal for quick, binary decisions such as turning notifications on, switching themes, or enabling features in apps and dashboards.

Use Case: Switching Between Views (e.g., Revenue & Profit)

In this article, I am going to demonstrate how to create a toggle button to help you switch between views e.g., switch between a Revenue and a Profit view.

Create two Visualizations (Revenue vs. Profit)

Using the Sample – Superstore data, create two visualizations showcasing the Monthly Revenue and Profit as shown below.

a bar chart
a bar chart

Creating a Dashboard

To create a dashboard.

  • While in tiled mode, add a horizontal or vertical container into the dashboard area.

  • Drag one of the above visualizations into the container to create the view below.

bar chart added into dashboard

Next, float another container onto the first one.

Resize it to fit or make it slightly larger than the first one.

layout container floated onto dashboard

While in tiled mode, drag the second viz into the floated container.

Change the background color of the containers to white to create the view below.

bar chart added into the floated layout container

(Note, the above view shows the floated visualization which hides the first visualization)

Creating Toggle Button

To add the toggle button,

  • Select the floating container and…

  • Choose Add Show/Hide Button

enabling show/hide button on dashboard container

Float the button at your preferred location within the dashboard.

Next, edit the default buttons and replace them with custom buttons or shapes.

editing show/hide button for more customization

In this case, I am going to replace the Item Shown and Item Hidden buttons with custom toggle buttons (switch buttons) that I have downloaded from Flaticon site.

  • When Item Shown >> show Right switch button

  • When Item Hidden >> show Left switch button

replacing show/hide buttons with custom shapes and icons

Executing the above creates the view below.

view displaying toggle button

Adding Text Boxes for Clarity

Lastly, add text boxes at both ends of the toggle button as shown below.

Adding more context to the toggle button

Final Visualization

See the final visualization.

final view, showcasing the toggle button at play

Conclusion

Toggle buttons have become an essential part of modern Tableau dashboards, offering a simple yet powerful way to enhance interactivity and guide users through different analytical perspectives. By giving viewers, the ability to switch views, metrics, or scenarios with a single click, toggle buttons help keep dashboards clean, flexible, and user‑friendly.

As dashboards continue to evolve toward more dynamic, story‑driven experiences, toggle buttons stand out as a practical design element that improves both usability and insight discovery. Incorporating them thoughtfully can elevate the overall experience and make your dashboards feel more intuitive, polished, and engaging.

If you like the work we do and would like to work with us, drop us an email on our contacts page and we’ll reach out!

Thank you for reading!!

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

WhatsApp: +254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page