HOW TO CREATE DYNAMIC TITLES USING FILTER ACTIONS AND COUNTD IN TABLEAU

How to Create Dynamic Titles Using Filter Actions and COUNTD in Tableau

The ability to filter dashboards is one of the top requirements in developing business dashboards. If there is a way to slice the data you can almost guarantee that a stakeholder will list that as a “must-have”. In cases where you have multiple filters, can select more than one option in a list, or apply filters across multiple dashboards, dynamic titling can be a helpful tool.

Writing a descriptive and clear dashboard and worksheet tiles is an effective way to reduce the time for users to understand your charts and move quickly to gain insights. For example, when filtered by transportation type, a chart title of “Transportation Costs over Time” is less clear than “First-Class Mail Costs over Time”. Although a small detail, these touches unconsciously improve the user experience. There are several ways to create titles in Tableau dynamically. This blog post uses filter actions and the COUNTD (Count Distinct) function.

In this dashboard, when the user selects one or more states on the map, the bar graphs filter to show the selected state(s) data.  As a visual cue to the user, we will update the current dashboard title to “Accident Claims Summary | <Selected State> ” when one state is selected. When two or more states are selected, we will insert “Multiple States,” and when unfiltered, we will use “United States”.

Accident Claims Summary

Create Dynamic Title Calculated Field

First, create your calculated field. The key to this is to use an aggregate function such as MIN, MAX or ATTR to fix the cannot mix aggregate and non-aggregate comparison error.

 

IF COUNTD([State]) = 1 THEN MIN([State])

   ELSEIF COUNTD([State]) = MIN({COUNTD([State])}) THEN “United States”

        ELSE

“Multiple States”

END

CREATE DYNAMIC TITLE CALCULATED FIELD
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Creating a New Worksheet as Dashboard Title

Create a new worksheet and place the new calculated field on the Text marks card. Make sure this calculated field is placed to the right of the hard-coded text. This worksheet will serve as the new dashboard title.

Edit Label

Adding Dynamic Title and Filter Action to Dashboard

Add this worksheet to the top of the dashboard. The dashboard title should read “ACCIDENT CLAIMS SUMMARY | United States”. Select the map worksheet and click on the filter icon to add the filter action to all the worksheets.

Adding Filter in Tableau
Select a state or multiple states to see the dashboard title update according to your selections.
Tableau Dashboard
Want to Learn More?

Have any questions, comments, or curiosities? Feel free to reach out to me about dynamic titles on LinkedIn or via email: alice.mcknight@tessellationconsulting.com

About Tessellation

We are a modern analytics consultancy. We enable and manage organizations’ analytics and self-service teams by educating people, optimizing technology, developing world-class products, and providing sustainable results. Curious to know how we can level up your organization’s analytics? Click here!

Interested in joining the Tessellation Team as a data analyst, Tableau expert, dashboard designer, or data scientist? We’re hiring! Check out our latest job listings on our website and on our Linkedin page!

Subscribe to Our 'Data Cap' Newsletter!

Want a monthly insights from the Tessellation Team with tips, tricks, and secrets to improve your analytics?

Sign up below and we'll deliver articles, events, and how to's straight to your inbox.
Comments are closed.