Tableau Simples #11: Top Sub-Category in the Chart Title

by Henry Mak

Although you could display the Sub-Category with the highest Sales by placing Sub-Category onto the Text Marks card and then filter out to the Top N Sales, there is a potential problem with this method. The problem is that it hinders accessibility.

During our training on accessibility, we found that screen readers cannot read the text on the Text marks card. Therefore, if we wanted to create any BANs or extra information we'd have to do it via the chart title.

Here's how to do it. In this tutorial we will be using the Superstore dataset included in Tableau.

1. Place Sales onto the columns and then Sub-Category onto the rows

2. Sort Sub-Category by Sales in descending order

3. Create a calculated field called 'Top Sub-Category'

WINDOW_MAX( IF WINDOW_MAX(SUM([Sales])) = SUM([Sales]) THEN MAX([Sub-Category]) END )

4. Place this new calculated field onto the Detail marks card

5. Finally insert this calculated field onto the title by editing the title, going to Insert and then clicking on your calculated field. Format as necessary

And there you have it. Of course, feel free to switch things around e.g. Sales into profit etc. In any case, I hope you've learned a new way to display the highest performing sub-category.

Tableau Public