How to Create a Subcategory in Tableau

Cody Schneider9 min read

Sometimes your top-level data categories, like "Technology" or "Office Supplies," are just too broad to give you any real insight. To truly understand what's driving performance, you need to break them down into more specific subcategories. This article will show you exactly how to do that in Tableau using Groups, Calculated Fields, and Hierarchies so you can go from a high-level overview to a detailed analysis with just a few clicks.

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 Creating Subcategories?

Working with top-level categories alone is like trying to navigate a city with only a map of the country - you know the general area, but you're missing the important details. Creating subcategories unlocks a more granular level of analysis so you can answer specific business questions and build more effective visualizations.

Here’s why it's worth the effort:

  • Deeper, More Specific Insights: Instead of just knowing that "Furniture" sales are up, you can pinpoint that "Chairs" are driving growth while "Tables" are lagging behind. This allows you to make more informed decisions, like adjusting your marketing spend or optimizing your inventory.
  • Cleaner, More Readable Visualizations: A bar chart with 50 individual product names is cluttered and overwhelming. Grouping those products into logical subcategories like "Laptops," "Monitors," and "Keyboards" makes your charts easier to read and understand at a glance.
  • Interactive Drill-Down Capabilities: By combining categories and subcategories into a hierarchy, you empower your audience to explore the data for themselves. They can start with a broad view and click to drill down into the specific areas that interest them, moving from "Technology" to "Phones" to "Specific Models" with ease.

In short, subcategories transform your dashboards from static reports into interactive analytical tools.

Method 1: Creating Subcategories with Groups (The Quick & Easy Way)

The simplest way to create a subcategory in Tableau is by using the "Group" feature. This method is perfect for when you need to manually bundle members of a dimension together based on your own knowledge.

When to Use Groups

Choose the grouping method when:

  • Your subcategories are static and don't need to change as new data comes in.
  • You want to quickly combine a few specific items.
  • The logic is simple, for example, grouping several state names into a custom sales region like "Pacific Northwest" (Oregon, Washington, Idaho).

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 Guide to Creating a Group

Let's walk through an example. Imagine we have a list of products and we want to group several different types of chairs into a single "Seating" subcategory.

  1. Find Your Dimension: In the Data pane on the left side of your worksheet, locate the dimension field you want to group. In our case, this would be Product Name.
  2. Start Creating the Group: Right-click on the Product Name dimension and select Create > Group.... This will open a new window where you can build your groups.
  3. Select Members for Your First Group: The window will list all the individual members of the Product Name dimension. Find and select all the chair-related items. You can hold down the Ctrl key (or Command key on a Mac) to select multiple items at once. For instance, select "Executive Chair," "Office Chair," and "Guest Chair."
  4. Form the Group: With the items selected, click the Group button. Tableau will bundle them together under a single name. You can then click "Rename" to give this group a more descriptive title, like "Seating."
  5. Create More Groups (Optional): You can continue this process for other product types. For example, select "Filing Cabinet" and "Bookshelf," click Group, and rename the new group to "Storage."
  6. Handle Ungrouped Items: You might have a checkbox labeled Include 'Other'. If you check this, Tableau will create a final bucket for any items you didn’t manually assign to a group. This is useful for preventing miscellaneous items from cluttering your view.
  7. Finish and Use Your New Field: Click OK. You will now see a new field in your Data pane called Product Name (group). You can drag this field onto your worksheet just like any other dimension to see your sales data organized by your new subcategories.

Using Groups is fast and intuitive, but it’s a manual process. If you add a new "Dining Chair" to your data next month, it won't be automatically added to your "Seating" group. For that kind of dynamic logic, you'll need calculated fields.

Method 2: Using Calculated Fields for Dynamic Subcategories

Calculated fields offer a more powerful and flexible way to create subcategories. Instead of manually selecting items, you write formulas that automatically categorize your data based on specific rules or conditions. This means your subcategories will automatically update as your data changes.

When to Use Calculated Fields

Calculated fields are the better choice when:

  • You need to categorize data based on specific business logic (e.g., if a product name contains the word "Phone," classify it as "Mobile Devices").
  • Your subcategories depend on a measure (e.g., flagging orders over $500 as "High Value").
  • You have a large dataset where manual grouping would be impossibly tedious.
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

Creating Subcategories with a CASE Statement

A CASE statement is one of the cleanest ways to build rule-based categories. It checks a field for a specific value and then assigns an outcome. Think of it as telling Tableau: "In case the [Category] is 'Technology,' check for these other conditions..."

Let's create subcategories within our main Category dimension based on keywords in the Product Name.

  1. In the Data pane, click the drop-down arrow at the top right and select Create Calculated Field....
  2. Name your new field something clear, like Product Subcategory.
  3. In the formula box, enter a CASE statement. We'll nest some IF CONTAINS() logic inside it for extra precision.
CASE [Category]
WHEN "Technology" THEN
    IF CONTAINS([Product Name], "Phone") THEN "Mobile Phones"
    ELSEIF CONTAINS([Product Name], "Printer") THEN "Printers & Peripherals"
    ELSEIF CONTAINS([Product Name], "Laptop") THEN "Computers"
    ELSE "Other Technology"
    END
WHEN "Office Supplies" THEN
    IF CONTAINS([Product Name], "Paper") THEN "Paper Goods"
    ELSEIF CONTAINS([Product Name], "Pen") OR CONTAINS([Product Name], "Pencil") THEN "Writing Instruments"
    ELSE "General Office Supplies"
    END
ELSE [Category]
END

Breaking Down the Formula:

  • CASE [Category]: This tells Tableau which field we are evaluating.
  • WHEN "Technology" THEN...: This is the first rule. If the Category is exactly "Technology," then Tableau will proceed to the nested IF/ELSEIF logic inside.
  • IF CONTAINS([Product Name], "Phone") THEN "Mobile Phones": Inside the Technology block, this logic checks if the product’s name includes the text "Phone." If it does, it's assigned to the "Mobile Phones" subcategory.
  • ELSE "Other Technology": The final ELSE is a catch-all. If a product is in the "Technology" category but doesn't meet any of the IF conditions, it gets put here.
  • ELSE [Category]: The ELSE statement at the very end of the calculation handles any categories we didn't explicitly define a rule for (like "Furniture"). Instead of creating a subcategory, it just returns the original category name.
  • END: Every CASE and IF statement must be closed with an END.

After clicking OK, you can drag your new Product Subcategory field into your view to see your dynamically organized data.

Level Up: Combining Your Subcategories with Hierarchies

Creating groups or calculated fields is great, but the real magic happens when you organize them into a hierarchy. A hierarchy allows you to drill up and down through different levels of detail directly on your chart.

For example, you could start by viewing sales by Category. Then, with a single click, you could expand it to see the breakdown by your new Product Subcategory.

How to Create a Hierarchy

  1. Find Your Fields: Locate both your parent category (e.g., Category) and your new child subcategory (e.g., Product Subcategory or Product Name (group)) in the Data pane.
  2. Drag and Drop: Click on your subcategory field and drag it directly on top of your parent category field. You'll see the parent field get highlighted a bit before you release the mouse button.
  3. Name Your Hierarchy: A window will pop up asking you to name the hierarchy. You could call it something like "Product Drilldown." Click OK.
  4. Arrange the Levels: In the Data pane, you'll now see the new hierarchy. You can drag other fields into it to create more levels. Make sure they are ordered from most general to most specific (e.g., Category → Product Subcategory → Product Name).

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.

Using the Hierarchy in a View

Now, instead of dragging individual fields onto your Rows or Columns shelves, drag the entire hierarchy pill. You'll notice a small "+" symbol next to the field name on the pill. Clicking this plus sign will instantly expand the view to the next level in your hierarchy, and a "-" sign will appear to let you collapse it back up.

This creates a clean, interactive user experience that lets anyone viewing your dashboard explore the data without needing to know anything about Tableau.

Final Thoughts

Mastering subcategories in Tableau is a fundamental step toward building truly insightful and professional dashboards. Whether you use the quick and simple Group feature for manual bucketing or the powerful logic of Calculated Fields, being able to refine your dimensions gives you much deeper control over your analysis. And by organizing them into hierarchies, you make your data accessible and explorable for everyone.

Creating these kinds of custom dimensions and drill-downs is exactly the kind of detailed work that can take a lot of time in traditional BI tools. We built Graphed because we believe getting answers from your data shouldn't require writing complex formulas or manually configuring dashboards. Often, you just want to ask a question like, "Show me my top-performing product subcategories from Google Analytics by revenue" and see an answer instantly. Graphed connects to your marketing and sales platforms, allowing you to ask questions in plain English and get back real-time, interactive dashboards in a matter of seconds, giving you that valuable time back to focus on strategy instead of report-building.

Related Articles