Moving BANs in Tableau (Dynamic Zones #3)

BANs (big numbers representing KPIs or other important info that pop out to users immediately) are a powerful tool in any dashboard creator’s arsenal. In today’s post, we’ll explore how you can use Dynamic Zone Visibility to make your BAN layout change as your dashboard changes.

Beautiful layouts and reactivity are sometimes opponents in Tableau design. A perfect dashboard flexes with the user, and can change to meet their needs – but Tableau tends to work best with a fixed design. Dynamic zone visibility goes a long way towards fixing that.

In this post, we’re going to look at one specific way a dashboard can change as the user interacts with it: The layout can change based on the parameters a user selects. This sounds kind of abstract, so I’m going to jump straight into an example. As always, you can find the workbook for this example on Tableau Public.

The Scenario

In this example, I’m using the Tableau superstore dataset. Sales are broken down into three segments: Home Office, Consumer, and Corporate. Some users will want to see numbers for those segments directly, so I want my visual to be able to show all three. I can create a view with a chart and three BANs on the right hand side, displaying the share of sales going to each segment.

However, lets say that some of my users are really only interested in the difference between corporate and non-corporate clients. I want to give them the ability to lump “Home Office” and “Consumer” together so that they can see the numbers at a glance without doing any mental math. In this case, I have a chart with only two colors and two BANs on the right hand side.

Let’s look at how you can allow users to switch between these two layouts with a simple parameter and dynamic zone visibility. I’ll start by doing this with Tableau native formatting – at the end of the post there is a bonus section about how to incorporate background images into this too, like in the images above

Step 1: Create BAN Sheets

For this technique, we’ll be using BANs that are each created on their own sheet. (In some use cases, you can create BANs all on the same sheet – if that works for your situation, do that! It’s simpler and doesn’t require dynamic zone visibility. However, if you want more control over formatting, like using coordinating title colors, you’ll be using separate sheets).

Start by creating a sheet for each BAN card you want to appear. In my case, I need four separate sheets – “Corporate”, “Home Office”, “Consumer”, and “Home & Consumer”. I’ll never see all four of these sheets on my final dashboard at the same time, but they all need to exist in the workbook.

(For the purposes of this tutorial, I won’t go into the process of creating the BANs themselves – we’ll focus on layout. If you’d like to see more details on BAN creation in a future post, leave a comment below! You can also check out the example workbook to see how these work.)

Step 2: Lay Out the Dashboard

Next, let’s put all of these BANs onto a dashboard. All of the BAN sheets need to be in the same horizontal or vertical container. Make sure the view for each sheet is set to “entire view”, and that you don’t fix the height/width of any of them – they need to be free to adjust automatically.

I’ve also added a simple stacked bar chart here – it’s not part of the tutorial, but shows a common way BANs can be laid out.

If you want to use Tableau’s built-in tools for formatting, you can add that now – I’ve included some outlines and a very transparent background gray for each BAN, and changed some of the padding. (If you want to use a background image instead, check out the bonus section at the end of this post.)

Step 3: Add a Controlling Parameter

Now we’re going to add the parameter users will interact with to change how many BANs they see.

Use a boolean parameter type, and alias the values to a more human-friendly form. You can go ahead and add the parameter control to your dashboard now as well.

Step 3: Flip the Parameter

The main way this use-case differs from the show/hide chart in our first post in the series is that when we show one element, we want to simultaneously hide another. To do that, we’re also going to need a calculated field that flips the parameter we just made.

This calculated field is always going to be the opposite of the parameter, whatever value is selected.

Step 4: Add Dynamic Zone Controls.

Now we can head back to the dashboard, and add the dynamic zone visibility. First of all, let’s look at the “Home & Consumer” combined BAN. I want this to show up whenever the parameter (Combine Home and Consumer) is True, so I’ll set that parameter as the controller for that sheet.

For the “Consumer” and “Home Office” BANs, I want the opposite to happen – I want them to show when the parameter is False. That’s not a direct option for dynamic zones, which is why we built that calculated field in the last step. Whenever the parameter is false, the calculated field (“Separate Consumer and Home”) will be True, so we can use that as the controller for both the “Consumer” and “Home Office” sheets.

Be sure to apply the same process to all of the BANs that you want to be dynamic – in this case, I applied the same controller to “Consumer” and to “Home Office”. “Corporate” doesn’t change between views, so I can leave it alone.

Step 5: Celebrate!

That’s it! Some of your sheets will have disappeared as you set up the dynamic zone controls, but when you change the parameter, they’ll reappear.

Bonus: Background Images

Because Tableau’s backgrounding tools are lacking, many viz designers use image backgrounds to layout dashboards. You can use this same technique to make the background image change along with the BANs, so that the layout stays logical.

Start by creating two versions of the background image – one for each possible layout. As usual when adding a background image, you’ll need to float the container holding all of your dashboard pieces.

Size and arrange the backgrounds appropriately. They should be floating as well, but on a lower level than the content itself. Make sure the two backgrounds line up exactly so that you don’t get a weird jump effect when switching between them.

Finally, use the same parameter and calculated field to control the visibility of the two background layers. I’ve made the two-card version appear when “Combine Home & Consumer” is selected on the parameter, and vice versa for the three-card version.

Wrap-Up

And that’s it! Now you can make dynamic BANs. Before you go, make sure to check out the other posts in the dynamic zone series, and subscribe in the sidebar on the right to never miss a post.

Let's keep in touch! New tips, tricks, and tutorials are posted about once a week - sign up to get them straight to your inbox!

I don’t spam! Read the privacy policy for more info.

Leave a Reply

Your email address will not be published. Required fields are marked *