How to Combine Rows in Tableau

Cody Schneider7 min read

Combining rows in Tableau is a fundamental skill for cleaning your data and creating clearer visualizations. Whether you need to group similar categories, simplify a dimension, or append data from multiple files, Tableau offers several ways to get it done. This tutorial will walk you through the most common and effective methods for combining rows.

When and Why You Should Combine Rows in Tableau

Before jumping into the “how,” it’s helpful to understand the “why.” You’ll often find yourself needing to combine rows when your raw data isn’t perfectly structured for analysis. Here are a few common scenarios:

  • Data Cleaning: Your data might have inconsistent entries like “United States,” “USA,” and “U.S.” Combining these into a single "USA" row makes your analysis accurate.
  • Creating High-Level Categories: You might want to group detailed sub-categories into broader ones. For instance, combining “Chairs,” “Tables,” and “Bookcases” into a single “Furniture” category.
  • Comparative Analysis: You may want to group several smaller segments to compare them against a major performer, like combining all minor marketing channels to compare against "Organic Search."
  • Appending Data Sets: You have data spread across multiple files or tables, such as monthly sales reports, that need to be stacked on top of each other for a complete view.

Whatever your reason, mastering these techniques will save you headaches and unlock deeper insights from your dashboards.

Method 1: Using Groups for Quick, Manual Combinations

The simplest way to combine dimension members in Tableau is by creating a group. This method is perfect for quick, one-off fixes or when you need to manually select a handful of items to combine. It's an entirely visual process, requiring no code.

Let's say you have a list of US states and you want to group them into custom sales regions like "Pacific Coast" and "Mountain West."

Step-by-Step Guide to Creating a Group:

  1. Identify the Dimension: In the Data pane on the left, find the dimension whose members you want to group. In our example, this would be the [State] dimension.
  2. Create the Group: Right-click on the [State] dimension and select Create > Group...
  3. Select and Group Members: The "Create Group" dialog box will appear, listing all members of the dimension. To create your first group, hold down the Ctrl key (or Command on Mac) and click on "California," "Oregon," and "Washington." Then, click the Group button.
  4. Create Additional Groups (Optional): You can continue this process inside the same dialog window. For example, select "Arizona," "Colorado," and "Utah," click Group, and rename the new group to "Mountain West."
  5. Manage Ungrouped Members: By default, any members you don't add to a group will remain listed individually. To clean this up, you can check the box for "Include 'Other'". This will lump all remaining members into a single catch-all "Other" group.
  6. Complete the Group: Click OK. Tableau will create a new field in your Data pane, usually named [State (group)]. You can now drag this new grouped dimension onto your view just like any other field to create visualizations based on your new categories.

Best for: Small, static lists and quick, visual data organization where the grouping rules won't change often.

Method 2: Using Calculated Fields for Rule-Based Grouping

When your grouping logic is more complex or needs to be easily updated, a calculated field offers more power and flexibility. This method involves writing a simple formula using IF, ELSEIF, or CASE statements to define how rows should be combined.

Imagine you want to group products into "High Profit" and "Low Profit" categories based on their profit margin. You can't easily do this with a manual group, but it's perfect for a calculation.

Example using an IF Statement:

An IF statement is great for simple binary or sequential logic. Let's create a calculated field that groups products based on sales volume.

Steps to Create the Calculated Field:

  1. In the Data pane, click the drop-down arrow at the top and select Create Calculated Field...
  2. Give your calculation a name, such as "Sales Tier."
  3. In the formula box, enter the following logic:
IF SUM([Sales]) > 10000 THEN "Top Tier"
ELSEIF SUM([Sales]) > 2000 THEN "Mid Tier"
ELSE "Bottom Tier"
END
  1. Click OK. You now have a new dimension called "Sales Tier" that you can use to see how many products fall into each performance bucket.

Example using a CASE Statement:

A CASE statement is often cleaner and more efficient when you have multiple, distinct conditions to check against a single dimension. Let's say we want to combine several Sub-Categories from the Sample - Superstore dataset.

Steps to Create the Calculated Field:

  1. Create a new calculated field and name it "Product Group."
  2. Enter the following CASE statement in the formula box:
CASE [Sub-Category]
WHEN "Chairs" THEN "Furniture"
WHEN "Tables" THEN "Furniture"
WHEN "Bookcases" THEN "Furniture"
WHEN "Furnishings" THEN "Furniture"
WHEN "Phones" THEN "Technology"
WHEN "Accessories" THEN "Technology"
WHEN "Machines" THEN "Technology"
ELSE "Office Supplies"
END
  1. Click OK. Drag this new "Product Group" dimension into your view to see sales, profit, or any other measure aggregated by these new, broader groups.

Best for: Dynamic grouping based on rules or measures, scenarios where you may need to update the logic later, and creating categories based on multiple conditions.

Method 3: Using Unions to Append Data from Multiple Sources

Sometimes, "combining rows" literally means stacking data sets on top of each other. This is common when you have data spread across multiple text files, Excel sheets, or database tables with the same structure. For example, monthly sales exported into separate CSV files (Jan_Sales.csv, Feb_Sales.csv, etc.). Tableau's Union feature handles this perfectly.

When you union tables, Tableau appends the rows from each source into a single, combined table.

Step-by-Step Guide to Creating a Union:

  1. Open the Data Source Tab: Connect to your first data file (e.g., Jan_Sales.csv). Tableau will display it in the data source canvas.
  2. Add Other Tables to the Union:
  3. Review the Result: Tableau combines the data and adds two new, generated fields to your data source: [Table Name] and [Sheet]. These fields tell you which source each row came from, which is incredibly useful for filtering or creating calculations based on the origin of the data.

Best for: Combining data from multiple files or tables that have identical column structures, such as time-based reports or data segregated by region.

Choosing the Right Method for Your Needs

With several options available, here’s a quick summary to help you decide which method to use:

  • Groups: Use for quick, manual, and visual grouping of dimension members. Best for static categories.
  • Calculated Fields: Use when your grouping is based on a set of rules, conditions, or measures. This is the most flexible and powerful method for recategorizing data.
  • Unions: Use when your goal is to append rows from separate-but-similar data files or tables into one master data set.

Final Thoughts

Learning how to combine rows effectively is a game-changer for cleaning messy data and telling a clearer story with your visualizations. By using groups for simple manual tasks, calculated fields for powerful rule-based logic, and unions for appending data, you have a complete toolkit to prepare your data for any analysis directly within Tableau.

Getting your data shaped correctly in tools like Tableau is often the most time-consuming part of analysis. At Graphed, we’ve built an experience that automates much of this data prep. By connecting your sources, you can use natural language to instantly build dashboards - we handle the work of grouping, combining, and visualizing your marketing and sales data in the background. If you're looking for a faster way to get from raw data to real-time insights, you might enjoy using Graphed to have an AI data analyst do the heavy lifting for you.

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.