Tell me more, tell me more! In this post, we’ll look at how to use Tableau’s dynamic zone visibility to let users “zoom in” on dashboard elements to get to a more detailed view.
(New to dynamic zones? Start here)
Zooming in is a fun and widely relevant use for dynamic zone visibility. This isn’t a new ability for Tableau – we’ve long been able to create pop-up boxes to show additional details by using the show/hide button feature – but using dynamic zone visibility adds a little extra flexibility and UX smoothness.
Here’s when I would use dynamic zone visibility instead of a show/hide button for a detail zoom-in:
-If the dashboard design would have buttons in unwanted places. (For example, maybe the place you want your “zoom-out” button is right on top of one of the charts in the overview).
-If you want users to zoom in by interacting with a native dashboard element (like clicking on a chart or title) instead of using a specific zoom button.
-If you want to include multiple layers in the zoom-in pop up, like an image background for the panel.
The first reason is the most important reason to use dynamic zones instead of show/hide buttons, because it changes the user experience. This can make your dashboards feel more intuitive and easy-to-use, which is always a win!
Let’s take a look at how the zoom-in pop up works with dynamic zone visibility.
Step 1: Make Some Charts
To start out, you’ll need some sheets to represent your data. We’re going to build these both at the high-level view (before zooming in) and at the detailed view that will be shown in the zoom-in panel.
I started by creating some KPI boxes to go on my main dashboard. Each box contains a text sheet and a spark line, and each represents one region from the Superstore dataset.
(Want to follow along? As always, you can download this workbook from my Tableau Public)
Next, I built detail views for each region. I’m keeping this simple for demonstration purposes, so I just made one chart for the detail view. However, you could definitely make multiple elements to put in one container for your zoom-in instead.
Step 2: Controlling Parameters and Calculations
Next, we’ll add the parameters that will control what’s visible on the dashboard. I need four parameters, one for each region. Each parameter should be a boolean True/False.
Make sure to create a separate parameter for each zoom-in panel you’ll have. I made four, one for each region.
In order to actually change the parameters, we’ll need two calculated fields. One should be named “false” and be the boolean value FALSE, and one should be named “true” and contain TRUE.
Lastly, I’m going to use the four parameters I created earlier to make one more calculated field. I’m going to have some elements on my page that I want to appear if any of the zoom-ins are activated (in my case, the pop-up background and the zoom-out button), so I’ll create a single field that will be true if any of the four controlling parameters are true.
Step 3: Prep the Sheets for Actions
Now that we have our sheets, parameters, and calcs set up, let’s make this thing actually work!
Add the “true” calc you created earlier as a detail on any sheet you to be click-to-zoom I want my viewers to click on any of the region summaries, so I’m adding the “true” calc to the details card for each of the 4 KPI sheets.
These four sheets will act as my controllers to zoom in on details.
Repeat the process with the “false” calc for any sheets you want to act as a “zoom-out”. I decided to use a button for this, so I created an additional sheet that just contains a single symbol (placed on the “false” calc)
Step 4: Add Parameter Actions
Here’s where everything comes together. Head back to your dashboard, and start adding the sheets that will appear with a zoom-in. (Remember, I’m using single sheets here, but you could also use multiple sheets in a container in the same way).
I’ve started by putting the two elements that will appear any time I zoom in: the pop-up background and the zoom-out button.
I made the background in Figma and added it as a floating image, but you definitely don’t need to do this if you don’t want to – you can use a blank object, or skip the background altogether and just use charts.
Click on each of these elements and set visibility to be controlled using “Show Background”. (This is the field we made earlier that’s true if any of the zoom-ins are true).
Next, let’s make the zoom-out button actually work. You’ll need four parameter actions, one for each zoom-in parameter. In each parameter action, select the controlling sheet for the zoom-out (the button, in my case). Each action will set one of the zoom-in parameters to “false”.
Test it out – if you click the zoom-out sheet, the background image and button should disappear.
Now let’s make components appear!
You’ll need one parameter action per zoom-in option. For each parameter action, start by setting the controlling sheet (in this example, that’s the KPI sheet for the region).
Set the target parameter to be the corresponding zoom controller, and the source field to be “True”. (Not seeing the “True” field as an option? Make sure that you’ve selected a source sheet you added “True” to as a detail in step 3).
Repeat this for each zoom control.
Step 5: Add (more) dynamic zone controls
All the parameters we need are set up, so we just have to add the detail sheets and set some more dynamic visibility! One at a time, add your zoom-in sheets (or containers of sheets) to the dashboard. I chose to make these floating, but you could tile them as well – it just takes a little more planning.
Then select the sheet, check “control visibility using value” in the “Layout” tab, and set the controller to the matching parameter that we made in step 2.
Once you have those four dynamic zones set up, you are done! Click around and test out the function to make sure it all works, and adjust the layout as needed.
The End
Thanks for reading! Before you go, make sure to subscribe in the side bar to get notified when I add new use cases for dynamic zone visibility to the series. Happy vizzing!
Leave a Reply