How to Do Cumulative Sum in Tableau
Need to see how your sales are adding up toward a quarterly goal, or visualize subscriber growth over the course of a year? A cumulative sum, also known as a running total, is the perfect way to track progress over time. This article will walk you through exactly how to create a cumulative sum in Tableau using two simple and effective methods.
What Exactly is a Cumulative Sum?
A cumulative sum is a sequence of partial sums of a given set of data. In simpler terms, it’s a running total. For each new data point (like a month or a day), the cumulative sum adds the value of that point to the total of all the preceding points.
Here’s a quick example. Imagine your monthly sales figures are:
- January: $10,000
- February: $12,000
- March: $8,000
The cumulative sum would look like this:
- January: $10,000
- February: $10,000 + $12,000 = $22,000
- March: $22,000 + $8,000 = $30,000
This is extremely useful in business reporting for tracking performance against targets, understanding trends in accumulation, or seeing when you cross important thresholds. A standard bar chart might show you that March was a weaker sales month, but a cumulative chart shows you that you're still at $30,000 for the quarter.
Method 1: Using a Quick Table Calculation
The fastest and most straightforward way to create a cumulative sum in Tableau is by using the Quick Table Calculation feature. This is ideal for quick analysis and when you don’t need to reuse the calculation in other worksheets.
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 1: Build Your Initial View
Start by creating a simple chart showing your measure over a time dimension. For this example, let's look at Sales by Month.
- Drag your date dimension, like
Order Date, onto the Columns shelf. Right-click on it and choose the date value you want, such as "Month" (the option that looks like "May 2017"). - Drag your measure, like
Sales, onto the Rows shelf.
You should now have a basic line chart or bar chart showing your total sales for each month.
Step 2: Add the Running Total Calculation
Now, let's transform these monthly totals into a running total.
- Locate the
SUM(Sales)pill on your Rows shelf. - Right-click (or click the small dropdown arrow) on the
SUM(Sales)pill. - In the context menu that appears, hover over Quick Table Calculation.
- From the list of options, select Running Total.
Instantly, Tableau recalculates the values in your chart. Instead of showing the sales for each individual month, each data point now represents the cumulative sum of sales up to and including that month.
Step 3: Review and Refine Your Chart
Your chart should now show a steadily increasing line or set of bars representing the cumulative sales. You can change your mark type to a Line for a classic running total visualization or keep it as bars. You can also drag the SUM(Sales) pill to the Label card on the Marks shelf to see the exact cumulative value at each point.
Method 2: Using a Calculated Field
While the Quick Table Calculation is fast, creating a calculated field gives you more flexibility and control. A calculated field is a reusable element that you can use across multiple worksheets, in other calculations, and in more complex business logic.
Step 1: Open the Calculated Field Editor
First, you need to create a new calculated field.
- Go to the top menu and select Analysis > Create Calculated Field.
- Alternatively, you can right-click in an empty space on the left data pane and select Create Calculated Field.
Step 2: Write the Running Sum Formula
A new window will pop up. This is where you'll define your calculation.
- Give your calculation a descriptive name, like "Cumulative Sales".
- In the formula box, type the following function:
RUNNING_SUM(SUM([Sales]))
Let's briefly break this down:
SUM([Sales]): This inner part first aggregates theSalesmeasure for the given level of detail in your view (e.g., for each month).RUNNING_SUM(...): This outer function then takes the result ofSUM([Sales])for each mark and performs a running total calculation across them.
Once you've entered the formula, a small message "The calculation is valid." should appear. Click OK.
Your new "Cumulative Sales" field will now appear in the Measures section of the Data pane on the left.
Step 3: Use the Calculated Field in Your View
Now, simply use this new calculation just like any other measure.
- Drag your date dimension (
Order Date) to the Columns shelf and set it to "Month." - Drag your new
Cumulative Salescalculated field from the Measures pane onto the Rows shelf.
The result will be the same cumulative sum chart you created with the Quick Table Calculation. The key difference is you now have a reusable measure called "Cumulative Sales" that you can use anywhere in your workbook.
Common Issue: The "Compute Using" Setting
Whether you use a quick table calculation or a calculated field, you might run into situations where the running total isn't calculating as you expect, especially in more complex charts (like a stacked bar chart with categories).
This is almost always related to the Compute Using direction.
Tableau needs to know in which direction to perform the 'run'. Should it sum across a table, down a table, or within a specific pane?
- Right-click on your table calculation pill (either the Quick Table Calc or your new Calculated Field) on the Rows shelf.
- Go to the Compute Using option.
- By default, Tableau often uses "Table (across)" for time series data, which is usually correct. However, if you have breakdowns by another dimension (like
Category), you might need to adjust this. For example, using "Pane (down)" might calculate a running total for each category separately.
Experimenting with the "Compute Using" options is the key to solving most common running total issues. By choosing a specific dimension here (e.g., Order Date), you tell Tableau explicitly to perform the cumulative sum along the points of that dimension.
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.
Putting It All Together: A Practical Example
Let's say your sales team has a yearly sales goal of $700,000. You can use your new cumulative chart to visualize progress towards this target.
- Create the Cumulative Sales Chart: Use either of the methods above to create your running total of sales by month for the year.
- Add a Reference Line:
You now have a powerful visualization that not only shows your month-over-month accumulation of revenue but also provides immediate visual context on how close you are to hitting your annual target. You can see precisely which month you crossed the goal or project when you might based on the current trend.
Final Thoughts
Creating a cumulative sum in Tableau is a fundamental skill for tracking progress and understanding performance trends over time. Whether you use the simple Quick Table Calculation for fast analysis or a more robust Calculated Field for reusability, you are now equipped to build powerful running total visualizations for any important metric.
While Tableau is an incredibly capable tool, it sometimes takes dozens of clicks and a deep understanding of concepts like table calculations to get the insights you need. At Graphed, we're building a simpler way. Instead of writing formulas and configuring calculations, you just connect your sales and marketing data and ask a question, like: "Show me a running total of Shopify sales this year versus our monthly goal spreadsheet". We generate the real-time dashboard instantly, saving you from the manual work so you can focus on making decisions, not building reports.
Related Articles
Facebook Ads for Landscapers: The Complete 2026 Strategy Guide
Learn how to run profitable Facebook ads for landscapers in 2026. This complete guide covers audience targeting, ad formats, budgeting, and optimization strategies to generate leads at $30-50 per lead.
Facebook Ads for Painters: The Complete 2026 Strategy Guide
Learn how to run profitable Facebook ads for painters in 2026. This complete guide covers audience targeting, ad formats, budgeting, and optimization strategies to generate leads at $20-60 per lead.
Facebook Ads for Chiropractors: The Complete 2026 Strategy Guide
Discover how chiropractic practices can leverage Facebook advertising to attract new patients in 2026. Learn the top strategies, compliance requirements, and proven ad templates that drive appointments.