Repeat Row Labels in Tableau

When I was working on a Tableau report, I had the row labels grouped instead of being repeated for every row. With this, it was difficult to read the table because users had to view each row to understand which row label applied to it.

For example, instead of seeing the row header repeated on each line, Tableau displayed a single grouped header for multiple rows. For a clear view, I needed a way to display repeated row labels for each row.

In this Tableau tutorial, I’ll explain how to show repeated row labels in Tableau using the INDEX() function and by creating a combined field calculation.

Display Repeated Row Labels for Each Row in Tableau

In Tableau, we can display repeated row labels for each row using the methods below.

  • Repeat row labels in a Tableau using the INDEX() function
  • Repeat row labels in a Tableau using a combined field
  • Repeat row labels in a Tableau using a combined calculation

Repeat Row Labels in Tableau Using the INDEX() Function

In this method, we will create a calculated field using the INDEX() function. Now, open the Tableau worksheet and follow the steps below.

  1. For the text table view, I have added the Category and Sub-Category to the Rows and measures Quantity and Sales to the Columns.
Repeat row labels in Tableau

Now, we will display the category label for each sub-category row using the calculated field.

  1. To create a calculated field, click the Analysis tab -> Create a Calculated Field.
How to repeat nested rows labels in Tableau
  1. Enter the Label for the calculated field and enter the formula as “INDEX()“, then click OK.
Show repeated Row Labels in Tableau
  1. Drag the calculated INDEX() field to the Rows and place it before all dimensions. Then, to remove the index labels, click on the calculated field in Rows and uncheck Show header.
How to repeat Category row labels in Tableau

Now, we can see that Category values are repeated for each Sub-category in the table row.

How To Display Repeated Row Header In Tableau

This way, we can display the repeated row labels in Tableau using the INDEX() function.

Repeat Row Labels in Tableau Using a Combined Field

Another method is to show the repeated label by using the combined field in Tableau.

  1. For the table view, I have added Category and Sub-category to the Columns and Measure (Sales) to the Rows.
  1. After this, press the “Ctrl” key and select Category and Sub-category from the Data pane, and select Create -> Combined Field.
Use repeated Row labels in Tableau
  1. Drag the combined Category & Sub-Category field to the left on Rows. With this Category column, the label for each sub-category will be shown in the Rows.
Add label for repeated rows in Tableau
  1. To remove the labels of the combined fields, click on it in the Rows and uncheck Show header.
Display Repeated Row Headers in Tableau

At last, we will get the table with the repeated row label for the Category column for each row of Sub-Category.

This way, we can repeat row labels in Tableau using the combined fields.

Repeat Row Labels in Tableau Using a Combined Calculation

This method is similar to the combined fields method, but in this case, we combine the fields using a field calculation, allowing us to use it in other Tableau worksheets and dashboards as well.

Now, follow the steps below to show repeated row labels in Tableau using a combined calculation.

  1. Drag Category and Sub-category to the Columns and Measure (Sales) to the Rows to create a text table view.
  1. To create a combined calculation, click on the Analysis tab -> Create Calculated Field.
Show repeated Row Labels in Tableau using Combined calculation
  1. Enter the label for the calculated field, such as Combined, and in the formula, combine the fields using the “+” sign. For example, we are displaying Category and Sub-Category so that the formula will be [Category]+[Sub-Category].
Create a calculated field to show repeated row label in Tableau
  1. Now, drag the calculated field to the Rows and position it before the dimension Category and Sub-Category.
Repeated Row Labels in Tableau Table
  1. To remove the labels of the calculated field from the table, click on the field in the Rows and uncheck Show header.
Add labels to all rows in Tableau

Now, we can see the row label for categories for each sub-category in the table.

Display Row Labels for Each Row in Tableau Crosstab

This way, we can show repeated row labels in Tableau using a combined calculation.

Conclusion

In this Tableau tutorial, we have learned how to repeat row labels in Tableau instead of showing them as grouped headers. In the above examples, we learned about three approaches: using the INDEX() function, creating a combined field, and building a combined calculation.

Each of the above methods helps make the table easier to read by showing clear labels for every row. Depending on the reporting needs, we can select the method to improve the readability of the Tableau reports.

You may also like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.