How to Sum in Tableau

Cody Schneider8 min read

Getting a total sum in Tableau is one of the most fundamental steps in data analysis. While it might seem like a simple drag-and-drop action, Tableau offers several powerful ways to calculate sums that can unlock deeper insights. This guide will walk you through the essential methods for summing in Tableau, from the straightforward default aggregation to more advanced calculated fields and level of detail expressions.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

First, A Quick Refresher: Measures vs. Dimensions

Before jumping into a SUM function, it's vital to understand how Tableau sees your data. It automatically classifies your fields into one of two categories:

  • Dimensions: These are categorical fields that you use to slice and dice your data. Think of them as the 'who,' 'what,' and 'where' in your dataset. Examples include Region, Product Category, and Customer Name. In the data pane, dimensions are usually blue.
  • Measures: These are the quantitative, numerical fields that you perform mathematical calculations on. Think of them as the 'how much' or 'how many.' Examples include Sales, Profit, and Quantity. In the data pane, measures are normally green.

You sum measures, and you slice them by dimensions. Keeping this distinction in mind will solve 90% of the initial confusion you might encounter when building your first few visualizations.

Method 1: The Simple Drag-and-Drop Sum

The easiest and most common way to get a sum is to let Tableau do the work for you. By default, when you drag a measure onto a worksheet, Tableau automatically wraps it in a SUM() aggregation.

Let's use a common example: total sales by region.

Step-by-Step Instructions:

  1. Connect to your data source (we'll use the sample Superstore dataset for this example).
  2. From the Dimensions pane, drag the Region field onto the Rows shelf. You will now see a list of the four regions.
  3. From the Measures pane, drag the Sales field onto the Columns shelf.

Just like that, Tableau generates a bar chart displaying the total sum of sales for each region. If you look at the Sales pill on the Columns shelf, you'll see it reads SUM(Sales). Tableau automatically applied the summation because you are looking at a numeric measure sliced by a qualitative dimension.

To see the numbers themselves, you can drag the Sales measure again, this time dropping it onto the Label box on the Marks card. This will display the total sales amount on each bar in your chart.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 2: Using SUM() in a Calculated Field

While the drag-and-drop method is great for quick visualizations, you'll often need to use SUM() inside a custom calculation. Calculated fields allow you to create new metrics that don’t exist in your original dataset, such as profit ratio or year-over-year growth.

Let’s say you want to calculate the profit ratio, which is typically calculated as Profit / Sales. If you try to create a calculated field with just [Profit] / [Sales], Tableau might throw an error or produce odd results because it doesn't know how to aggregate these numbers. You can't divide every single row of profit by every single row of sales. You need to divide the total sum of profit by the total sum of sales.

Step-by-Step Instructions:

  1. Right-click anywhere in the data pane and select Create Calculated Field.
  2. Name your calculated field. Let's call it Profit Ratio.
  3. In the formula box, type the following expression:
SUM([Profit]) / SUM([Sales])
  1. The calculation editor will tell you the calculation is valid. Click OK.

You now have a new measure called Profit Ratio that you can use in any visualization. If you drag it into your view, Tableau will compute the total profit, compute the total sales, and then divide the two, according to the dimensions in your view (like Category or Region). By wrapping each measure in SUM(), you're telling Tableau to first aggregate the data to the level of detail of your viz and then perform the division.

To see the new calculated field as a percentage, right-click on it in the Measures pane, go to Default Properties > Number Format..., and select Percentage.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 3: Grand Totals with the TOTAL() Function

Sometimes you need to show not just the sum for each category, but also a total sum for the entire table or window. The TOTAL() function is a table calculation that helps you accomplish this. It sums the values across the entire partition you specify.

This is extremely useful for calculations like finding the percent of total. For example, what percentage of the company's total sales did the 'Technology' category contribute?

Here’s how you can calculate the percent of total sales for each product category.

Step-by-Step Instructions:

  1. Create a view showing SUM(Sales) by Product Category. Drag Category to Rows and SUM(Sales) to Columns.
  2. Create a new calculated field and name it Percent of Total Sales.
  3. Enter the following formula:
SUM([Sales]) / TOTAL(SUM([Sales]))

Let's break this down:

  • SUM([Sales]): This gives you the sum of sales for each category individually (e.g., the sum for 'Furniture,' the sum for 'Office Supplies,' etc.).
  • TOTAL(SUM([Sales])): This gives you the sum of sales across the entire table. So, for every row, this value will be the grand total.

By dividing the individual sum by the total sum, you get the percentage of the whole for each category.

  1. Drag your new Percent of Total Sales calculated field onto the Label on the Marks card. Remember to format it as a percentage!

Method 4: Advanced Summing with Level of Detail (LOD) Expressions

Level of Detail (LOD) expressions give you even more control over how your sums are calculated. They allow you to compute values at a different level of granularity than what is currently in your view. The most common LOD is FIXED.

A FIXED LOD expression computes a value for the specified dimensions, regardless of what other dimensions are in the view.

Imagine this scenario: you want to see the total sales for each region, but you have Category in your view. Normally, SUM(Sales) would give you the sales per category within each region. But what if you need to know the entire region's sales on every line for a further calculation? This is where FIXED comes in.

Step-by-Step Instructions:

  1. Let's build a view with both Region and Category on the Rows shelf and SUM(Sales) on the Text label. You'll see sales broken down by both dimensions.
  2. Now, create a new calculated field and name it Regional Sales (FIXED LOD).
  3. Enter the following formula:
{ FIXED [Region]: SUM([Sales]) }

This calculation tells Tableau: "For every distinct region, calculate the total sum of sales, and for every row belonging to that region, show me that same total sum."

  1. Drag this new calculated field onto your view next to the standard SUM(Sales).

You will now see something interesting. The SUM(Sales) column shows a different value for 'Furniture,' 'Office Supplies,' and 'Technology' within each region. However, the Regional Sales (FIXED LOD) column shows the same value for every category within a region - that region's grand total. This is incredibly powerful for complex calculations, like comparing a category's sales to its region's total sales.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 5: Cumulative Sums with Running Total

A running total, or cumulative sum, is another common analysis task. You might want to see how sales have accumulated over a year or how inventory levels have changed over time.

Tableau makes this incredibly easy with Quick Table Calculations.

Step-by-Step Instructions:

  1. Create a line chart showing sales over time. Drag Order Date to Columns (and set it to Continuous Month) and SUM(Sales) to Rows. You'll see a line chart of your monthly sales.
  2. Right-click the SUM(Sales) pill on the Rows shelf.
  3. From the context menu, choose Quick Table Calculation > Running Total.

Instantly, your line chart will transform. Instead of showing the sum of sales for each individual month, it now shows the cumulative sum. The second point on the chart is the sum of Month 1 + Month 2, the third point is Month 1 + Month 2 + Month 3, and so on. This is a one-click way to see your performance build over a specific time period.

Final Thoughts

From a simple drag-and-drop to complex LODs, Tableau provides a robust toolkit for summing your data, allowing you to answer business questions of varying complexity. Mastering these different methods will empower you to move beyond basic reporting and uncover meaningful, actionable insights hidden in your numbers.

While mastering functions like SUM() and LODs in Tableau is a valuable skill, it often involves a steep learning curve and wrestling with calculations to get the view just right. At Graphed, we felt this pain firsthand. That’s why we built a tool that lets you connect your marketing and sales data and just ask for the sum - like "What was our total sales by region last quarter?" - and an interactive dashboard is built for you in seconds. It empowers your entire team to get answers from your data without needing to become dashboarding experts first.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!