How to Add a Sum Column in Tableau
Adding a total or sum column to a table seems like it should be simple, but in Tableau, there are a few different ways to get the job done, each with its own advantages. Whether you need a quick grand total for a report or a dynamic sum column to calculate percentages, this guide will walk you through the most effective methods. We’ll cover everything from Tableau’s built-in features to the power of Level of Detail (LOD) expressions.
The Quickest Method: Tableau’s Built-in Totals Feature
If you just need to add a grand total row or column to your visualization, Tableau’s built-in functionality is the fastest way to do it. This method is perfect for summary tables where you want to show the final tally at a glance.
Let’s imagine you've built a simple table showing Sales by Product Category and Sub-Category.
Here’s how to add totals:
- Navigate to the top menu and click on Analysis.
- Hover over Totals in the dropdown menu.
- You’ll see several options. The most common ones are:
You can also add subtotals by selecting "Add All Subtotals" from the same menu. This will add totals for each dimension in your view (for example, a total for each Product Category).
The Catch: While this method is incredibly easy, it has one major limitation. The totals it generates exist only within that specific visual. You can't use them in another calculation. For instance, you can't create a new field that calculates what percentage of the Grand Total each Sub-Category represents. For that, you need a more flexible approach.
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.
How to Create a Separate Sum Column with {FIXED} LOD Expressions
This is the most powerful and common way to add a sum column, especially when you need that total for other calculations. Level of Detail (LOD) expressions allow you to compute values at a different level of granularity than what’s currently in your view. For our goal, we’ll use the {FIXED} expression to effectively "fix" a total for a specific dimension.
Let’s stick with our example: we have a table with [Category], [Sub-Category], and SUM([Sales]). Our goal is to create a new column that shows the total sales for the parent category on every single row. For example, every "Bookcases" and "Chairs" sub-category row should also show the total sales for the main "Furniture" category.
Step-by-Step Guide to Creating a {FIXED} Sum Column
Follow these steps to build your reusable sum column.
1. Create a New Calculated Field
In the Data pane (on the left side of your screen), right-click on any empty space and select "Create Calculated Field." This will open the calculation editor.
2. Name Your Calculated Field
Give your field a clear and descriptive name so you'll remember what it does. Something like "Category Total Sales" is perfect.
3. Write the {FIXED} LOD Formula
In the editor, type the following formula. This tells Tableau exactly how to calculate the sum.
{FIXED [Category] : SUM([Sales])}Let’s quickly break down what this means:
{ ... }: The curly braces signal to Tableau that this is an LOD expression.FIXED [Category]: This is the core of the expression. It tells Tableau, "For every unique value in the[Category]dimension, I want you to perform a calculation and always return the same result.": SUM([Sales]): This is the aggregation we want to perform. It calculates the sum of the[Sales]measure for each category defined in the first part of the expression.
In essence, this calculation creates the total sales for each category (Furniture, Office Supplies, Technology) and "stamps" that value onto every row belonging to that category.
4. Add the New Column to Your View
Click "OK" to save your calculated field. You’ll now see "Category Total Sales" in your Measures list. Drag it from the Data pane and drop it onto your Rows shelf, next to your SUM(Sales) measure. You can also drop it directly onto the "Text" box in the Marks card.
Your table will now show the sales for each sub-category right next to the total sales for its parent category, repeated for each row. Success!
The best part? This new "Category Total Sales" field is now a fully-fledged measure that you can use in any other calculation. For example, you can create another field to find the percentage of total sales:
SUM([Sales]) / SUM([Category Total Sales])
Alternative Method: A Grand Total Column with {EXCLUDE}
What if you want a column that shows the grand total of all sales on every row, instead of a category-level total? The {FIXED} method can do this as well ({FIXED : SUM([Sales])}), but you can also use another type of LOD expression: {EXCLUDE}.
The {EXCLUDE} function calculates an aggregation while ignoring some of the dimensions currently in your view.
To create a grand total column, you'd make a calculated field with this formula:
{EXCLUDE [Category], [Sub-Category] : SUM([Sales])}
This formula tells Tableau: "Calculate the total sum of sales for the entire dataset, but temporarily ignore the fact that the view is broken down by [Category] and [Sub-Category]." The result is a single value — the grand total of sales — that will appear on every single row of your table.
Developer Tip: The main difference between {FIXED} and {EXCLUDE} relates to filters. {FIXED} calculations are computed before most filters in the view. If you want a filter to apply to your {FIXED} calculation, you need to right-click that filter and select "Add to Context." {EXCLUDE} calculations, on the other hand, are computed after dimension filters, so they are affected by them without any extra steps.
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.
How to Use Table Calculations to Add a Sum Column
A third way to create a sum column is with table calculations. Unlike LOD expressions that can operate outside the context of your visualization, table calculations work only on the data currently visible in your table.
Using the same view, here's how you'd do it:
- Create a Calculated Field: Give it a name like "Category Total (Table Calc)."
- Enter the Formula:
WINDOW_SUM(SUM([Sales]))The WINDOW_SUM function sums up a measure across a specified "window" of data in your view.
- Add the Field to Your View: Drag the new calculated field into your table. At first, it will likely show the grand total for all categories. This is because we haven't told Tableau how to compute the window yet.
- Configure the Table Calculation: This is the most important step. Right-click the "Category Total (Table Calc)" pill in your view and select "Edit Table Calculation."
This will give you the same result as the {FIXED} LOD. So which one should you use?
LOD vs. Table Calculation: Which is Better?
- Use a
{FIXED}LOD expression when you need a stable, reusable value that isn't dependent on the structure of your worksheet. It's more robust and is generally considered the best practice for creating a portable "sum column." - Use a Table Calculation when your calculation is intimately tied to the layout of your visual. They can be less intuitive to set up and may "break" if you add or remove dimensions from your view, as this changes the "window" the calculation is working with.
Final Thoughts
Mastering total columns in Tableau opens up a new level of analysis. You can easily add simple grand totals with the Analysis menu for quick summaries, create robust and reusable fields using {FIXED} LOD expressions for deeper analysis like calculating percentages, or use table calculations for view-specific summaries. Knowing these techniques gives you the flexibility to handle almost any reporting request.
Of course, this process often involves digging through menus, writing formulas, and managing calculated fields. We built Graphed because we believe getting insights from your data shouldn't require a steep learning curve. Instead of writing LOD expressions or configuring table calculations, you can connect your data sources and simply ask questions in plain English - like "create a table of sales by sub-category and add a column for the total sales by category." We instantly create live, interactive dashboards for you, turning hours of manual work into seconds, so you can focus on making decisions, not building reports.
Related Articles
Facebook Ads for Accountants: The Complete 2026 Strategy Guide
Learn how to use Facebook ads for accountants to attract new clients in 2026. Discover targeting strategies, campaign setup, budgeting, and optimization techniques.
Facebook Ads for Electricians: The Complete 2026 Strategy Guide
Learn how to run high-converting Facebook ads for your electrical business in 2026. Covers campaign types, targeting strategies, and creative best practices.
Facebook Ads for Restaurants: The Complete 2026 Strategy Guide
Learn how to run profitable Facebook ads for restaurants in 2026. This comprehensive guide covers the 7 killer strategies, ad formats, targeting, and budgeting that top restaurants use to drive reservations and orders.