Sheet Swapping and Legend Popping in Tableau
top of page

Sheet Swapping and Legend Popping in Tableau

hands typing on a keyboard

Overview

Sheet Swapping in Tableau lets you dynamically switch between different visualizations on a dashboard using parameters or layout containers, while Legend Popping ensures that only the relevant legends or filters appear when a specific sheet is active.

Sheet swapping is a technique to replace one sheet with another in the same dashboard space.

Legend popping is a method to show or hide legends depending on which sheet is active.

The Problem

In this example, I am going to create two visualizations with different legends and using parameters and layout containers – enable dynamic popping of the legends based on the selected indicators.

Create two Visualizations

In this case, I am going to create two vizzes – showing a map of USA by Revenue and Profit.

Note in each of the visualizations I have applied a unique legend as shown below.

A visualization showing map of usa
A visualization showing map of usa

Create a Parameter

Next, I will create a parameter “Indicator” containing Revenue and Profit. This parameter will be used to hide and show the visualizations as well as the legends based on the active indicator.

See the parameter below.

Tableau parameter

Show the parameter in each of the visualizations.

Create a Calculation to Hide/Show the Visualizations Based on the Selected Indicator

Create a simple calculation “Hide/show” as follows.

tableau calculation

Next – head over to the first viz on Revenue and drag the above calculation to the filter shelf. Configure the filter as shown below.

tableau filter

(Executing the above ensures that the viz on Revenue is displayed when “Revenue” is selected on the indicator – otherwise, nothing is displayed).

Repeat the same on the second viz on Profitability. Configure the filter as At most - zero as shown below.

tableau filter configuration

(Similar to the Revenue viz, the above filter ensures that the viz on Profit is displayed when “Profit” is selected on the indicator – otherwise, nothing is displayed)

Creating a Dashboard (Leveraging Parameter & Layout Containers)

To create a dashboard displaying the above two views.

  • While using Tiled mode, add a layout container to the dashboard area.

  • Drag the two visualizations in the layout container.

  • Hide the titles of the visualizations.

  • Hide the titles of the legends.

See the resulting views when different indicators are selected on the parameter.

A visualization showing map of usa
A visualization showing map of usa

(Note the two visualizations can interchange seamlessly, only the legend clutters the view – especially when viewing the Revenue visualization)

Configuring Proper Display of the Legends

Create Hide/Show Worksheet

  • Create a simple worksheet containing a text string as shown below.

  • Add the calculation “Hide/show” to the filters card and configure it the same as the Profit view.

tableau worksheet

(The goal is to have this worksheet visible when Profit is selected on the parameter and hide it when Revenue is selected)

Reconstructing the Legends

  • Change all legends to floating objects.

  • Next, float a layout container where you would like to display the legends.

  • While in tiled mode, add the new worksheet created above into the layout container. Ensure you hide the title.

  • Next, add the legends into the same container in the order shown below i.e. start with the diverging legend followed by the discrete legend.

Tableau legends

While selected on the Profit indicator, add a white layout container (by floating it) to mask the table visible above the legend as shown below.

tableau legends

(This layout container will mask the table when Profit is selected, while at the same time mask the Profitability legend when Revenue is selected creating a seamless interaction between the legends.)

See the views below.

A visualization showing map of usa final
A visualization showing map of usa final

Conclusion

Sheet swapping and legend popping are more than clever tricks - they are powerful design strategies that elevate Tableau dashboards from static reports into dynamic, user-driven experiences. By leveraging parameters, layout containers, and calculated fields, you can give your audience the freedom to explore multiple perspectives without clutter or confusion. At the same time, legend popping ensures that only the most relevant context appears, keeping dashboards clean, intuitive, and focused.

Together, these techniques embody the essence of effective data storytelling: clarity, flexibility, and engagement. Whether you’re building dashboards for executives, analysts, or non-technical users, mastering sheet swapping and legend popping will help you deliver insights that are both actionable and delightful.

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