How to Combine Two Dimensions in Tableau

Cody Schneider8 min read

Wrestling with separate dimensions like “Category” and “Sub-Category” in Tableau can make your visualizations feel cluttered and hard to read. Instead of forcing your audience to connect the dots, you can create a single, unified field directly within the tool. This article will walk you through three different methods for combining two dimensions in Tableau: using a Combined Field, creating a Calculated Field, and building an interactive Hierarchy.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why Bother Combining Dimensions in Tableau?

Before jumping into the "how," let's quickly cover the "why." Combining dimensions isn't just a technical trick, it's a practical way to make your reports more insightful and user-friendly. Here are a few common reasons you'd want to do this:

  • Enhance Readability: Joining a “First Name” and “Last Name” field into a single “Full Name” column makes lists and labels cleaner. Similarly, combining "Category" and "Sub-Category" gives you clear, descriptive labels like "Technology > Phones" instead of two separate columns.
  • Create Unique Identifiers: Sometimes a single field isn't unique enough. You might combine an “Order ID” with a “Product ID” to create a truly unique OrderItemID that helps you analyze individual items within a larger order.
  • Build Interactive Drill-Downs: For geographic or product data, combining dimensions into a hierarchy (e.g., Region > State > City) allows you and your users to explore the data by expanding and collapsing levels right in the dashboard.
  • Simplify Charting and Analysis: Having a single, combined dimension can make it easier to build certain types of charts and tables, reducing the number of fields you have to drag into your view.

Each of the methods below serves a different purpose, so you can choose the one that works best for your specific goal.

Method 1: The Quick and Easy “Combined Field”

The fastest way to join two or more text-based dimensions is by using Tableau’s built-in “Combined Field” feature. This method is perfect when you just need to staple dimensions together and aren’t too concerned about how they’re separated.

Let's use a classic example: combining First Name and Last Name columns from a customer list.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Step-by-Step: Creating a Combined Field

  1. In the Data pane on the left side of your screen, locate the dimensions you want to combine. In this case, find your First Name and Last Name fields.
  2. Hold down the Ctrl key (or Cmd key on a Mac) to select both fields at the same time. You’ll see both are highlighted.
  3. Right-click on either of the highlighted fields to open the context menu.
  4. Navigate to Create > Combined Field….
  5. Tableau will instantly create a new dimension in your Data pane, usually with a name like First Name & Last Name (Combined). You can right-click this new field and select "Rename" to give it a simpler name, like Full Name.

Now, you can drag your new Full Name field onto the Rows shelf, and you'll see a list of full names. However, you'll immediately notice the one limitation of this method: Tableau, by default, separates the values with a comma and a space. So you'll see "Smith, John" instead of "John Smith."

Pros and Cons of Using a Combined Field

  • Pros:
  • Cons:

Method 2: The Flexible "Calculated Field"

When you need more control over how your dimensions are combined, the Calculated Field is your answer. This method lets you write a simple formula to specify exactly how the fields should be joined, including the separator. It's the most common and versatile way to combine string dimensions.

Let's explore this with two practical examples.

Example 1: Combining Product Category and Sub-Category

Imagine you have product data with “Category” (e.g., Technology, Office Supplies) and “Sub-Category” (e.g., Phones, Binders). You want to create a new field that displays this as "Technology > Phones".

Step-by-Step Instructions:

  1. In the Data pane, click the small dropdown arrow to the right of the "Dimensions" header and select Create Calculated Field…. A new window will pop up.
  2. First, give your calculated field a descriptive name. Let’s call it Product Path.
  3. In the formula box, you’ll join the two fields together using the + operator. Field names in Tableau formulas are always wrapped in square brackets []. Type the following formula:

[Category] + " > " + [Sub-Category]

Let’s break that down:

  • [Category] and [Sub-Category] reference your existing dimension fields.
  • The + signs are used to concatenate (or "add") the strings together.
  • " > " is the custom separator you want to insert between the values. Notice the spaces around the > to create some breathing room. You can put any text you want inside the quotes.
  1. Look for the “The calculation is valid” message below the formula box. If you see an error, double-check your spelling and syntax.
  2. Click OK.

Your new Product Path dimension will appear in the Data pane. When you drag it into a view, you’ll see nicely formatted values like “Office Supplies > Binders” and “Furniture > Chairs.”

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Example 2: Fixing the "Full Name" Problem

Remember how the Combined Field gave us "Smith, John"? We can use a calculated field to get it right. Create a new calculated field named Full Name (Corrected) with this formula:

[First Name] + " " + [Last Name]

This simple formula takes the value from First Name, adds a single space, and then adds the value from Last Name, giving you the perfect "John Smith" format.

Pros and Cons of Using a Calculated Field

  • Pros:
  • Cons:

Method 3: The Interactive "Hierarchy"

The first two methods create a new field with a combined value. The third method, creating a hierarchy, doesn't combine values into a string. Instead, it creates a relational, nested structure that allows you to "drill down" for more detail.

This is extremely useful for things like geographic data (Region > State > City), dates (Year > Quarter > Month), or product taxonomies (Category > Sub-Category > Product Name).

Let’s build a Geographic Hierarchy.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Step-by-Step: Creating a Hierarchy

  1. Go to your Data pane and identify the dimensions you want to nest. For this example, let's use Region, State, and City.
  2. Click and drag the child field directly on top of the parent field. Drag the State field and drop it right onto the Region field.
  3. A “Create Hierarchy” dialog box will appear. Tableau will suggest a name, often the name of the top-level field. Let’s name ours Location Hierarchy and click OK.
  4. You'll now see the Location Hierarchy in your Data pane, with Region and State nested inside.
  5. To add the next level, drag City and drop it into the Location Hierarchy, just below State. Ensure you see a horizontal line appear below State before you drop it.

Now for the fun part. Drag your new Location Hierarchy (or just the top-level Region element) onto the Rows shelf. You'll see a list of your regions, but now there's a small "+" icon next to each one. Click the "+" to expand a region and see all the states within it. Click the "+" next to a state to see all the cities. Clicking the "-" icon will collapse it back up.

Pros and Cons of Using a Hierarchy

  • Pros:
  • Cons:

Extra Tips & Best Practices

  • Use Descriptive Names: When you create combined or calculated fields, give them meaningful names. Instead of Calculation1, use something like Customer Full Name or Product Category Path.
  • Handling Different Data Types: You can only concatenate strings (text). If you need to combine a string dimension with a number, you'll need to convert the number to a string first using the STR() function in a calculated field. Example: "Order #"+STR([Order ID]).
  • Account for Nulls: If some of your data is missing (e.g., a customer has a first name but no last name), your combined field might look strange or show "null." You can use an IFNULL() function in a calculated field to handle this gracefully.

Final Thoughts

Whether you need a quick combination for analysis, full control over formatting, or an interactive drill-down experience, Tableau has you covered. By mastering the Combined Field, Calculated Field, and Hierarchy features, you can clean up your data, improve the clarity of your visualizations, and empower your users to explore insights more effectively.

While mastering tools like Tableau is rewarding, it often comes with a steep learning curve and hours spent on analytics tasks that detract from high-level strategic thinking. At Graphed, we help you skip the manual work by turning your data questions into automated dashboards. Simply connect your sources, then describe what you want - like “create a bar chart showing sales by the combined product category and sub-category.” We build the visualization for you in seconds, letting you get straight to the insights without getting lost in the weeds.

Related Articles