How to Collapse Rows in Tableau
Building a detailed table in Tableau is powerful, but sometimes it gives your audience too much information at once. To create cleaner, more focused reports, you need a way to let users collapse and expand rows to see the level of detail they care about. This guide will walk you through a few practical methods for adding collapsible rows to your Tableau dashboards, from simple hierarchies to interactive parameters.
Why Collapse Rows in the First Place?
Before diving into the "how," it's worth understanding the "why." A sprawling table with dozens or hundreds of rows can be overwhelming. Collapsible sections, often called drill-downs or accordions, solve a few key problems:
- Reduced Clutter: It directs your audience's attention to the high-level summary first. They don't have to sift through line items to find the totals that matter most.
- Better User Experience: Interactive exploration is more engaging than scrolling through a static, endless table. Users feel more in control when they can choose what to investigate further.
- Faster Dashboard Performance: Displaying fewer marks (data points) on the initial load means your dashboard will render faster, which is especially important when working with very large datasets.
In short, collapsible rows make your dashboards smarter, cleaner, and more enjoyable to use.
Method 1: The Simple & Fast Way with Hierarchies
The most straightforward way to create collapsible rows is by using Tableau's built-in hierarchy feature. If your data has a natural parent-child relationship (like Category and Sub-Category, or Region and State), this method is perfect.
Imagine you have a sales table showing different product categories and a layer of detail underneath them called sub-categories. You want to start by showing only the total sales for each main category.
Step-by-Step Guide to Creating a Hierarchy:
- Create the Hierarchy: In the Data pane on the left, find your "child" dimension (e.g., Sub-Category). Drag it directly on top of your "parent" dimension (e.g., Category).
- Name Your Hierarchy: A dialog box will pop up asking you to name the hierarchy. You can call it something like "Product Details" or simply "Products." Click OK. You'll now see your dimensions nested under the hierarchy name.
- Build Your View: Drag the top-level dimension from your new hierarchy (in this case, Category) onto the Rows shelf. Then, place your measure (e.g., Sales) onto Text on the Marks card.
That's it! You'll now see a small + icon next to each category name in your table. Clicking this icon expands the row to show the sub-categories, and the icon changes to a -, which you can click to collapse it again.
Pro Tip: To expand or collapse all rows at once, right-click on one of the dimension headers in your view and select Expand All or Collapse All from the context menu.
Method 2: Give Users a "Show/Hide" Button with Parameters
Hierarchies are great, but sometimes you want to give the user a clear, single control - like a button or dropdown - to expand or collapse everything at once. This is where parameters shine. This method offers a more controlled, dashboard-friendly user experience.
We'll create a parameter an end-user can toggle to switch between a summary view (collapsed) and a detailed view (expanded).
Step-by-Step Guide with Parameters:
1. Create the Parameter
- In the top-left corner of the Data pane, click the small dropdown arrow and select Create Parameter.
- Configure the parameter settings:
- Click OK. Your new parameter will appear at the bottom of the Data pane. Right-click on it and select Show Parameter to make it visible on your sheet.
2. Create a Calculated Field
Now, we need a calculation that tells Tableau which level of detail to display based on the parameter's selection.
- Click the dropdown in the Data pane again and choose Create Calculated Field.
- Name it something like "Detail Level Display".
- Enter the following formula:
IF [Select View Level] = "Detailed View"
THEN [Sub-Category]
ELSE ""
ENDThis simple formula checks the parameter's current value. If it's "Detailed View," it returns the Sub-Category. Otherwise, it returns an empty string, effectively hiding it.
3. Build the Visualization
- Drag your parent dimension (Category) to the Rows shelf.
- Drag your new Detail Level Display calculated field to Rows, placing it right after Category.
- Drag your measure (Sales) onto Text on the Marks card.
Now, when you use the "Select View Level" parameter control and switch it to "Detailed View," all the sub-category rows will instantly appear. Switch it back to "Summary View," and they'll disappear, giving you a clean, collapsible table driven by a single toggle.
Method 3: Advanced Control with Set Actions
For the ultimate interactive experience, you can use Set Actions. This method allows users to click directly on a category in your chart to expand only that category, keeping the others collapsed. It feels very intuitive and is perfect for dashboards where users want to explore specific segments of the data one by one.
Step-by-Step Guide with Set Actions:
1. Create the Set
- In the Data pane, find your parent dimension (Category), right-click on it, and go to Create > Set.
- Name the set "Category Target Set". Don’t add any values to it for now—just click OK to create an empty set.
2. Create the "Drill-Down" Calculated Field
This calculation is similar to the one we used for parameters, but it checks if a category is inside our set.
- Create a new calculated field named "Sub-Category Drilldown".
- Use this formula:
IF [Category Target Set] THEN [Sub-Category] ELSE "" ENDThis calculation shows the sub-category for any category that is currently in the set.
3. Build the View in a Dashboard
- Create a worksheet. Place Category on the Rows shelf, then place the new Sub-Category Drilldown calculated field right next to it on the Rows shelf. Add your Sales measure to Text.
- Create a new dashboard and drag your worksheet onto the canvas.
4. Create the Set Action
This is where the magic happens. We'll tell the dashboard to modify the set whenever a user clicks on a category.
- With your dashboard open, go to the top menu and click Dashboard > Actions....
- In the Actions window, click Add Action and choose Change Set Values.
- Configure the action:
- Click OK to close both windows.
Now, test it out on your dashboard! Click on any category—like 'Technology' or 'Office Supplies'—and you’ll see the sub-category rows instantly appear just for that selection. Click away into the white space, and they'll disappear. It's an elegant way to build an interactive drill-down without cluttering the interface.
Final Thoughts
Learning to collapse rows transforms your Tableau tables from static data dumps into clean, interactive tools for analysis. Whether using simple hierarchies, convenient parameters, or dynamic set actions, each method empowers your audience to explore data on their own terms, focusing on the insights that matter most to them.
Of course, the journey to simplify reporting doesn't have to stop there. Instead of spending hours learning parameters or configuring set actions, tools now exist to build the exact viz you need just by describing it. At Graphed, we use natural language to do the heavy lifting for you. You can ask, "show me sales by category and sub-category," and an interactive report is generated instantly. This frees you from the tool-specific configuration so you can go straight from question to insight in seconds.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?