Creating Dynamic Subtitles in Tableau


Creating subtitles in Tableau is easy because Tableau provides and editor window for you to format the title and simply press the key at the end of the title to create a new line of formattable text. What’s really interesting is when we create a subtitle that is dynamic. This post requires that you have some prior knowledge of the COUNTD(), IF() and SUM() functions. You also need to know how to create calculated fields and basic graphs.

Here’s an article called How to Create a Subtitle in Tableau that Highlights Which Fields Have Been Filtered by Eric Parker.

The contents of the Edit Title dialog box is below.

<Sheet Name> with <Data Source Name>
For <AGG(Single or Multiple Category Label)><AGG(All Categories Label)>

In the above screenshot the user is hovering the mouse over the Corporate First Class bar.

Why would we go to the trouble of having this dynamic subtitle when the user can easily see that at the top right that the Furniture category is the only one checked? In busy dashboards it may not be so easy to tell if a filter has been applied.

The All Categories Label. This is a calculated field. Please create it to follow along.

IF COUNTD([Category]) = SUM({COUNTD([Category])}) THEN "All Categories" 
ELSE ""
END

The Single or Multiple Category Label. This is also a calculated field. Please create it.

IF MIN([Category]) = MAX([Category]) THEN "the " + MIN([Category]) + " Category"
ELSEIF COUNTD([Category]) = SUM({COUNTD([Category])}) THEN ""
ELSE "Multiple Categories"
END

Leave a comment

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