How to Create a Table Calculation in Tableau
Tableau's table calculations are one of its most powerful features, allowing you to perform calculations on the data you see in your visualization. This article walks you through exactly how to create, customize, and apply these calculations to uncover deeper insights in your data, all without needing to write complex code or change your underlying data source.
What Exactly Is a Table Calculation?
Think of a table calculation as a special type of formula that operates on the aggregated data in your view, not the individual raw rows in your data source. When you drag a measure like 'Sales' into a Tableau worksheet, Tableau first aggregates it (usually as a SUM). A table calculation is a secondary step that performs another calculation on top of that aggregated sum - like finding a running total, percent of total, or rank.
For example, if you have a bar chart showing total sales for each product category, a table calculation can tell you what percentage of the overall sales each category contributes. The key is that the calculation is dependent on the structure of your visualization (the "table" of data that Tableau is displaying).
How to Add a Quick Table Calculation
The easiest way to get started is with a "Quick Table Calculation." This is a preset menu of common calculations Tableau offers. Let's walk through an example.
Imagine you have a basic bar chart showing SUM(Sales) by Order Date (aggregated to the month).
- Drag
Order Dateto the Columns shelf and yourSalesmeasure to the Rows shelf. - This gives you a standard bar chart showing total sales for each month.
- Now, right-click (or Command-click on Mac) the
SUM(Sales)pill on the Rows shelf. - Hover over Quick Table Calculation.
- Select Running Total from the list.
Instantly, your bar chart transforms. Instead of showing sales for each individual month, it now shows the cumulative sales, with each bar adding to the previous one. You just created your first table calculation in a few clicks.
This quick menu includes several useful options:
- Running Total: A cumulative sum across your data.
- Difference From: The difference between the current value and another value in the table.
- Percent Difference From: The percentage change from another value.
- Percent of Total: The value as a percentage of the total for the entire table.
- Rank: The rank of each value (e.g., 1st, 2nd, 3rd).
- Moving Average: The average of the value across a specific number of previous periods.
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.
Understanding "Compute Using" - The Most Important Setting
Once you add a table calculation, the next question is: how does Tableau compute it? The "Compute Using" setting tells Tableau the direction and scope of the calculation. This is the single most important concept to master.
Let's say you have a table showing Sales by Year (rows) and Region (columns). You add a "Percent of Total" calculation. Should Tableau calculate each cell's percentage based on the grand total, its row total, or its column total? "Compute Using" answers this.
You can find this option by right-clicking your table calculation pill and hovering over Compute Using. Here's what the main options mean:
Table (Across)
The calculation is performed horizontally across the columns of the table for each row. In our example, it would compute the percentage of sales for each region within a single year, with each row adding up to 100%.
Table (Down)
The calculation is performed vertically down the rows of the table for each column. In our example, it would compute the percentage of sales for each year within a single region, with each column adding up to 100%.
Pane (Down) or Pane (Across)
"Pane" is a very useful scope. A pane is a sub-section of your table created by your dimension headers. If you had Quarters nested under Years on the rows shelf, "Pane (Down)" would perform the calculation within each Quarter, restarting for the next Quarter. This is perfect for calculating Percent of Total within a specific time period or category.
Specific Dimensions
This is the most granular and powerful option. It lets you explicitly tell Tableau which dimensions to include in the calculation and which ones should "partition" or restart the calculation. When you check off a dimension, you are telling Tableau to compute the calculation along that dimension.
Getting this setting right is the key to getting your table calculations to produce the numbers you expect.
Customizing Your Calculations: Editing and Saving
The Quick Table Calculation menu is a great starting point, but you'll often need more control. You can fully customize any table calculation.
Simply right-click the green pill with the little triangle symbol (∆) - which indicates a table calculation is active - and select "Edit Table Calculation..."
This opens a dialog box where you can:
- Change the Calculation Type: Switch from a Running Total to a Moving Average or Rank.
- Adjust Calculation-Specific Settings: For a Moving Average, you can define the period (e.g., average the previous 3 months). For a "Difference From" calculation, you can specify if it's relative to the previous, next, first, or last value.
- Fine-Tune "Compute Using": Visually select the specific dimensions to compute your calculation across. This often makes more sense than trying to guess between "Table (Across)" and "Pane (Down)."
Pro Tip: Once you've created a complex table calculation, you can save it for reuse. Drag the pill from your Rows/Columns/Marks shelf directly into the Data Pane on the left. Tableau will prompt you to name it, and it will be saved as a new calculated field that you can drag into other worksheets.
5 Practical Examples of Table Calculations
Let's bring this to life with a few common scenarios.
1. Running Total of Sales (Year to Date)
A running total is perfect for tracking cumulative progress toward a goal.
- Setup: A line chart with
Order Date(MONTH) on Columns andSUM(Sales)on Rows. - Calculation: Right-click
SUM(Sales), select Quick Table Calculation > Running Total. - Result: Instead of monthly sales spikes, you'll see a steadily climbing line representing your year-to-date sales.
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.
2. Percent of Total Sales by Category
Use this to understand a product's contribution to overall performance.
- Setup:
Categoryon Rows andSUM(Sales)on Text (in the Marks card). This creates a simple text table. - Calculation: Right-click
SUM(Sales), select Quick Table Calculation > Percent of Total. Set "Compute Using" to Table (Down) to calculate against the grand total. - Result: You'll see the percentage of total sales each category represents, giving you a clear view of your top performers.
3. Month-over-Month Sales Growth
Analyze trends and momentum with a difference or percent difference calculation.
- Setup:
Order Date(MONTH) on Columns,SUM(Sales)on Rows. - Calculation: Right-click
SUM(Sales), select Quick Table Calculation > Percent Difference From. Tableau automatically computes this relative to the previous month. - Result: A bar or line chart that shows the percentage growth or decline each month. Note the first month will be null, as there is nothing before it to compare to.
4. Rank Top Products by Profit
Easily identify your most and least profitable items without sorting.
- Setup:
Product Nameon Rows,SUM(Profit)on Columns. Sort descending for a clear view. - Calculation: Duplicate the
SUM(Profit)pill on the Rows shelf. Right-click the second pill and choose Quick Table Calculation > Rank. - Result: You can display the rank next to each product name, a classic use case for sales performance dashboards.
5. 3-Month Moving Average of Web Traffic
Smooth out noisy, volatile data like daily website sessions to spot the underlying trend.
- Setup:
Date(DAY) on Columns andSUM(Sessions)on Rows. - Calculation: Right-click
SUM(Sessions), select Quick Table Calculation > Moving Average. Right-click it again, select Edit Table Calculation, and you can specify the number of periods to average (e.g., summarize the previous 2 values plus the current one for a 3-day average). - Result: The visualization will now show a much smoother trend line, making it easier to see if your traffic is trending up or down over time, rather than reacting to daily fluctuations.
Troubleshooting Common Issues
- The numbers look wrong. Ninety percent of the time, the issue is an incorrect "Compute Using" setting. Triple-check it and use the "Specific Dimensions" option to be explicit.
- There are nulls in my visualization. This is expected for calculations that rely on previous or next values (like Difference From) at the beginning or end of your data range. There's nothing to compare against.
- The calculation breaks when I rearrange my viz. This is by design! Table calculations depend on the specific dimensions present in your view. If you remove a dimension the calculation relies on, it will need to be reconfigured.
Final Thoughts
Table calculations are an essential part of the Tableau toolkit. They give you the analytical flexibility to compare values, track progress, and find context directly within your dashboard. Mastering how to control their scope and direction with the "Compute Using" setting separates a beginner from a proficient Tableau user, empowering you to answer far more complex business questions.
While mastering Tableau is an incredibly valuable skill, sometimes you just need a straightforward answer without navigating complex settings. At Graphed, we’ve made getting insights as simple as asking a question. Instead of configuring calculations, you can connect your data sources and simply ask, “Show me the month-over-month sales growth this year as a bar chart.” We build the live, interactive visualization for you in seconds, letting you get insights without the steep learning curve.
Related Articles
Facebook Ads for Realtors: The Complete 2026 Strategy Guide
Discover how to use Facebook Ads for realtors to generate more leads in 2026. Learn proven strategies, targeting methods, and budget recommendations for your real estate business.
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.