How to Add Totals in Tableau

Cody Schneider••8 min read

Adding totals to your reports in Tableau is one of those fundamental tasks you'll need to do constantly. It's the quickest way to give your raw numbers context and a high-level summary at a glance. This guide will walk you through the simple built-in methods for adding totals and subtotals, and also show you some more advanced techniques for when you need greater control over your calculations.

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 Are Totals and Subtotals Important?

Before jumping into the "how," it's helpful to understand the "why." Grand totals and subtotals turn a wall of numbers into a structured, digestible report. They provide an immediate summary that helps answer key business questions instantly. For instance, in a sales report broken down by region and product category, subtotals can show you which region is performing best, while the grand total gives you the company's overall performance. They add a layer of summary analysis without requiring you to do any manual math or export data to a spreadsheet.

The Easiest Way: Using Tableau’s Built-in 'Totals' Feature

For most situations, Tableau's built-in functionality is all you need. It's fast, easy, and handles the most common use cases for text tables (also known as crosstabs).

Step-by-Step Instructions: Building a Basic Table

Let's start with a sample table so you can follow along. Imagine you're working with the classic Sample-Superstore dataset and want to see Sales by Region and Category.

  1. Drag the Region dimension to the Rows shelf.
  2. Drag the Category dimension to the Columns shelf.
  3. Drag the Sales measure to the Text mark on the Marks card.

You should now have a simple crosstab showing sales for each combination of region and category.

Adding Grand Totals

Now, let's add totals for all rows and columns. This is where the magic happens.

  1. Navigate to the top menu and click on Analysis.
  2. Hover over Totals.
  3. A new menu will appear. Here you have several options:

Click on Show Row Grand Totals. You'll see a "Grand Total" column appear on the right. Now go back and also select Show Column Grand Totals. A "Grand Total" row will appear at the bottom. Your table is now much more informative.

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.

Adding Subtotals

What if your table has more than one level of detail? Let's add the Sub-Category dimension to see how subtotals work. Drag Sub-Category from the Dimensions pane and drop it onto the Columns shelf, right after Category.

Your table is now more granular, but it could use subtotals to keep things organized. Here's how to add them:

  1. Go back to Analysis > Totals.
  2. Click on Add All Subtotals.

Instantly, Tableau adds a "Total" column after the sub-categories within each main category (e.g., a total for Furniture, a total for Office Supplies, etc.). This makes your table much easier to read and compare.

Customizing the Total Aggregation

By default, Tableau uses "Automatic" aggregation for totals, which usually defaults to SUM for measures like Sales. But what if you wanted to see the average sale per category instead of the sum? You can easily change this.

  • Right-click on the "Grand Total" label in the column header.
  • Hover over Total Using (Automatic).
  • You can now select a different aggregation, such as Average, Minimum, or Maximum.

This is a powerful feature that gives you quick flexibility without needing to write any code.

Using Calculated Fields for More Control

Sometimes, the built-in totals feature doesn’t meet your specific needs. You might want to display a total differently, or base it on a more complex condition. This is where Calculated Fields and Level of Detail (LOD) expressions come in handy.

LOD expressions allow you to compute values at a different level of granularity than the view you've built. This is perfect for creating custom totals.

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: Showing the Total Company Sales on Every Row

Let's say you want to calculate the percentage of total sales that each sub-category contributes. To do that, you need the overall Grand Total available on every single row of your data. A built-in total won't do that, but an LOD expression can.

  1. Open the "Create Calculated Field" dialog by clicking the dropdown on the top of the Data pane.
  2. Name your calculation something like "Overall Total Sales."
  3. Enter the following formula:

{ FIXED : SUM([Sales]) }

Let's break down that formula:

  • {}: These brackets signify that this is an LOD expression.
  • FIXED: This is an LOD type that computes the value based only on the dimensions you specify, regardless of what's in the view. Because we didn't specify any dimensions before the colon :, it will calculate the sum of sales across the entire dataset.
  • SUM([Sales]): This is the aggregate calculation we want to perform.

Now, drag your new "Overall Total Sales" calculated field into the view (onto the Text mark). You'll see the same grand total value repeated for every cell. From here, you could create another calculation like SUM([Sales]) / SUM([Overall Total Sales]) to get the percent of total for each individual mark.

Helpful Tips & Tricks for Working with Totals

Here are a few additional tips to help you get the most out of Tableau's totaling features.

Formatting Your Totals

Making your totals stand out visually is important for readability. You can format the grand totals and subtotals independently of the main data in your table.

  • Go to the Format menu at the top.
  • Select Totals.
  • A formatting pane will open on the left, allowing you to change the font (bold, italics), shading, alignment, and number format specifically for the Total and Grand Total sections of your view.

Totals on Different Chart Types

While most commonly used in text tables, you can add totals to other chart types as well. For a bar chart, the most common way to show a total is with a Reference Line.

Let's say you have a bar chart of Sales by Category.

  1. Go to the Analytics pane (next to the Data pane).
  2. Drag Total onto your view and when prompted, drop it on Table.
  3. Tableau will add a reference line showing the total of all bars. You can right-click the line to format it, change its label, and adjust its calculation (e.g., from Sum to Average).

Troubleshooting Common Totals Problems in Tableau

Sometimes totals don't behave the way you expect. Here are a few common issues and how to fix them.

Problem 1: Totals Are Not Showing Up

If you've enabled totals but they aren't appearing, double-check that your visual structure allows for them. Totals work on discrete aggregations. If you have continuous fields on both Rows and Columns (creating a scatter plot), totals aren't applicable. Ensure your view has discrete dimensions on the rows and columns to form a crosstab.

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.

Problem 2: My Totals Are Incorrect!

This is a common frustration, especially when working with aggregations that are not simple sums, like Count Distinct (COUNTD), Average (AVG), or Median.

For example, if you have a column showing the average profit ratio per Sub-Category, the Grand Total for that column is not the average of all the numbers you see in the column. Instead, Tableau re-calculates the profit ratio at a higher level (Total Profit / Total Sales). This is mathematically correct, but can be confusing if you expect it to just average the averages.

In these cases, remember that the Grand Total is its own calculation performed over the entire dataset partition, not a simple sum of the displayed numbers.

Problem 3: Subtotals Are Missing for a Specific Dimension

If you've turned on "Add All Subtotals" but one of your dimensions isn't getting a subtotal, you can enable it manually. Right-click the blue dimension pill on the Rows or Columns shelf and ensure that Subtotals is checked.

Final Thoughts

Displaying totals and subtotals is a core function of data reporting, and Tableau gives you a simple way to add them directly through the Analysis menu. For cases requiring more tailored logic, learning how to use Level of Detail expressions gives you the limitless flexibility to calculate and display summaries exactly how you need them.

Of course, building visualizations is only one part of the battle. The bigger challenge is often consolidating data from all your different platforms - Google Analytics, Shopify, Facebook Ads, Salesforce - just to get it into a tool like Tableau in the first place. That's why we created Graphed. We connect directly to your marketing and sales tools, allowing you to create real-time dashboards and get answers just by asking simple questions, without spending all day preparing data. Instead of configuring totals, you can just ask, "What were my total sales by region last quarter?" and get an interactive chart in seconds.

Related Articles