How to Create Hierarchy in Tableau

Cody Schneider8 min read

Building reports can feel like you’re just scratching the surface of your data. You create a chart showing sales by country, but immediately an executive asks, "Okay, but which states in our top country are driving that?" This article will show you how to use hierarchies in Tableau to answer those follow-up questions before they’re even asked by creating interactive, drill-down visualizations.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

So, what Exactly is a Hierarchy in Tableau?

Think of a hierarchy as a folder system for your related data fields. It logically organizes them from a broader category down to a more specific one. The most classic example is location data, which naturally flows from high-level to granular:

  • Country
  • State/Province
  • City
  • Postal Code

By grouping these fields into a hierarchy in Tableau, you give your charts a superpower: the ability to drill down and up. Instead of having separate charts for country, state, and city, you can build one visualization that lets your audience explore the data on their own terms. It saves space on your dashboard, makes for a cleaner user experience, and helps you uncover insights much faster.

For a marketing team, this could be organizing product data (Product Category → Sub-Category → Product Name) or campaign data (Campaign → Ad Set → Ad Name). For a sales team, it might involve organizing territory assignments (Sales Region → Territory → Sales Rep).

The core benefit is turning a static chart into an interactive analytical tool.

How to Create a Hierarchy in Tableau: The Step-by-Step Guide

Creating a hierarchy is one of the more straightforward things you can do in Tableau, and there are a couple of easy ways to do it. We'll use the location data from the common "Sample - Superstore" dataset that comes with Tableau for this example.

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Method 1: The Drag-and-Drop Technique (The Easiest Way)

This is the most common and intuitive method for building hierarchies. It provides a visual way to see how your fields are being grouped.

Step 1: Locate Your Fields in the Data Pane First, find the fields you want to group in the Data Pane on the left-hand side of your worksheet. For our example, let's find Country, State, City, and Postal Code.

Step 2: Drag One Dimension Onto Another Click on the field that represents the most granular level of your hierarchy (like City) and drag it directly on top of the field that is one level above it (like State). Don't let go until you see the target field get highlighted with a light gray box.

Step 3: Name Your Hierarchy When you release the mouse button, a dialog box will appear asking you to name your new hierarchy. It's best practice to give it a logical name that describes the group. We’ll call this one "Location." Click OK.

Step 4: Add More Fields to the Hierarchy You'll now see the "Location" hierarchy in your Data Pane, with State and City indented underneath it. The order matters here. To keep building it out, simply drag the other related fields into the hierarchy. Drag Country and drop it above State. Drag Postal Code and drop it below City.

Your finished hierarchy in the Data Pane should look like this, with each level logically indented:

  • Location

Method 2: The Right-Click and Create Method

If you prefer using menus, this method accomplishes the same thing without dragging and dropping.

  1. Hold down the Ctrl key (or Command on Mac) and click to multi-select all the fields you want in your hierarchy (Country, State, City, Postal Code).
  2. Right-click on any of the highlighted fields.
  3. Navigate to Hierarchy > Create Hierarchy...
  4. Give your hierarchy a name, like "Location," and click OK.

Tableau will do its best to order the fields logically based on the number of unique members in each, but you might need to reorder them manually by dragging the fields up or down within the newly created hierarchy folder.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

Using Your Hierarchy to Create Drill-Down Charts

Now for the fun part. Creating the hierarchy groups the fields, but using it in a view is where the magic happens. Let's build a simple map to see sales by location.

Step 1: Drag the Hierarchy to the View Drag the entire "Location" hierarchy from the Data Pane and drop it onto the marks card (specifically, onto Detail) or just into the middle of the empty canvas. Because Tableau recognizes these as geographic fields, it will automatically generate a map.

Step 2: Add a Measure Drag the Sales measure onto the Size mark. Now the dots on your map will represent the total sales for each country.

Step 3: Start Drilling Down Look at the Country pill in the Marks card. You'll notice a small "+" sign next to it. This is your drill-down button!

  • Click the "+" next to Country: The view instantly changes to show you sales by State. The Country pill is still there, but now State is visible too.
  • Click the "+" next to State: The map automatically deepens again to show you sales data at the City level.

At each level, you can also click the "-" sign to "drill up" and return to the previous, higher-level view. This simple interactivity allows you or your end-users to seamlessly explore geographic performance without ever leaving the dashboard or needing separate charts.

A Real-World Example: Analyzing Product Sales Performance

Let's move beyond geography. Imagine you're a marketing manager at an e-commerce company and you want to understand which product lines are performing the best. Building a hierarchy for your products is the perfect way to enable deep-dive analysis.

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Scenario a Marketing Manager can Use:

You want to see total sales for each main product category. From there, you want to identify the top-performing sub-categories within the best category, and finally, see the specific top-selling products in that sub-category.

1. Build the Product Hierarchy: In your Data Pane, find the Category, Sub-Category, and Product Name fields.

  • Drag Product Name onto Sub-Category.
  • Name the hierarchy "Products."
  • Drag Category into the "Products" hierarchy and place it at the very top.

2. Create the Visualization:

  • Drag the "Products" hierarchy onto the Rows shelf.
  • Drag the Sales measure a few times on Columns, and another on Text to show both Bar and Label values. Tidy this up into a new side-by-side or stacked bar chart showing sales, and the table text alongside it. This shows Categories and Sales.

Instantly, you have a bar chart showing total sales by category. You can clearly see that "Technology" and "Office Supplies" are the top performers. Now use the drill-down feature:

  • Drill Down to Sub-Category: Click the "+" beside the Category pill on Rows. Boom. The chart expands, breaking down each category bar into its constituent sub-categories. You can now see that within "Technology," it's "Phones" and "Chairs" leading the charge.
  • Drill Down another level into a Product: Want to see the specific products driving "Phones" sales? Click the "+" next to the Sub-Category pill. The view expands again to show individual product names and their sales figures.

In less than a minute, you’ve gone from a 30,000-foot view of your business to granular, product-level insights - all from a single, interactive chart.

Best Practices for Creating Hierarchies

While the process is simple, following a few best practices will make your hierarchies more effective and your dashboards easier to use.

  • Logical Order is a MUST: Always arrange your hierarchy from the most general field at the top to the most specific at the bottom (e.g., Year → Quarter → Month). An illogical order will confuse users and make the drill-down feel broken.
  • Keep Them Clean and Relevant: Don't just stuff every related field into one massive hierarchy. If a set of fields is only relevant to sales analysis, create a "Sales" hierarchy. If another is only for product management, create a "Products" one. Clarity is key.
  • Use Bins for Continuous Measures: Hierarchies aren't just for dimensions! You can create a hierarchy with a binned measure, like creating "Age Bins," to see a distribution and drill down within certain groups.
  • Alias Field Names for Clarity: If your underlying data fields have user-unfriendly names like Prod_Cat_L1, take a moment to right-click and rename them (alias) to something clear like "Product Category" before creating the hierarchy.

Final Thoughts

Tableau hierarchies are a foundational feature for transforming static reports into powerful analytical tools. By intelligently organizing your data, you empower users to explore levels of detail on their own, ask deeper questions, and discover insights that a high-level summary would have hidden. It’s a simple feature that adds immense value to any dashboard.

Mastering tools like Tableau requires a significant investment in learning clicks, menus, and configurations. At Graphed , we're building a different way forward. Rather than spending hours learning complex interfaces, we let you connect your data sources - like Shopify, Google Analytics, or Salesforce - and simply ask for what you need in plain English. Want to see sales by product line, then drill down into specific products? Just describe it, and we deliver an interactive, real-time dashboard in seconds, letting you get straight to the insights without the steep learning curve.

Related Articles