How to Drill Down a Single Row Hierarchy in Tableau

This guide will show you how to expand only the specific row you select to view its detailed items.

How to Drill Down a Single Row Hierarchy in Tableau

While Tableau provides a hierarchy feature, the UI representation can be very subtle, making it less intuitive for users. It also lacks flexibility if you want to drill down on selected items without affecting others.

In this article, we’ll look at a way to work around these limitations by expanding only the chosen row to reveal its sub-levels.

Step-by-Step: Drilling Down a Single Row Hierarchy

This approach uses a parameter action and subtotals to keep values visible at both the Category and Sub-Category levels.

  1. Create a parameter to capture the selected category item.

  1. Create a calculated field to add an arrow icon in front of the category name, guiding users to expand or collapse categories. If the parameter matches the value, display an expanded arrow icon (∨); if not, display a collapsed icon (>).

  1. Place the [Category] with arrows, [Sub-Category] on the Rows Shelf, and Sum of [Sales] on Columns shelf to create a bar chart. Sort both [Category] and [Sub-Category] in descending order of [Sales].

  1. Add Subtotals for the [Category], positioning them at the top. To enable Subtotals, first activate Grand Totals, then turn them off once Subtotals are enabled.

  1. Create a calculation to display only category subtotals and the selected category’s sub-categories. The SIZE function can help identify total and subtotal rows.

  1. Add the [Category TF] field to the Rows shelf to check results. Note that subtotal rows merge with the cell in front, so the value may not display.

  1. Hide any False values in the [Category TF] field. Be cautious not to filter them out directly, as doing so can lead to incorrect subtotal values.

  1. Create a calculated field to pass category values via parameter actions. If the parameter value matches the current category, pass a blank; otherwise, pass the category value, allowing users to collapse expanded items by selecting them again. Add this field to the Detail.

  1. Create a calculated field for category coloring, setting distinct colors for main categories and a uniform gray for sub-categories.

  1. Add the sheet to a dashboard and set up a dashboard action.

  1. Adjust formatting and sizing to finalize the dashboard.

💡
Other methods for displaying a hierarchy within a single dimension are available, though many involve data duplicate or complex LOD calculations, which may impact performance. Use them with care.