Creating charts and dashboards in Tableau helps visualise data, but sometimes we want deeper insights such as trends over time, rankings, growth rates, or cumulative performance. This is where Table Calculations become useful.
I learned how Table Calculations can help transform aggregated data into meaningful insights without changing the underlying data source. In this blog, I will explain what Table Calculations are, when to use them, and some common examples that analysts frequently encounter.
What Are Table Calculations?
Table Calculations are calculations that Tableau applies to the results shown in a visualisation. Unlike regular calculated fields, which are computed from the underlying data source before the view is built, Table Calculations are applied after the data has been aggregated and displayed.
Because they operate on data already visible in the view, their results depend on the visualisation's structure. Changes such as adding or removing dimensions, modifying the sort order, or adjusting the Compute Using settings can affect the calculation's outcome.
Order of Operation
- Data source filters
- Context filters
- FIXED LOD calculations
- Dimension filters
- Measure filters
- Aggregation (SUM, AVG, etc.)
- Visualisation is built
- Table Calculations
- Table Calculation filters
Common Table Calculations
Running Total
A Running Total continuously adds values as you move through the data.
For example, if monthly sales are:
| Month | Sales |
|---|---|
| January | 100 |
| February | 150 |
| March | 200 |
The running total would be:
| Month | Running Total |
|---|---|
| January | 100 |
| February | 250 |
| March | 450 |
This calculation is particularly useful for tracking cumulative sales, revenue, or customer growth over time.
Percent of Total
Percent of Total shows how much each value contributes to the overall total.
For example:
| Category | Sales |
|---|---|
| Furniture | 400 |
| Technology | 600 |
The percentage contribution would be:
- Furniture = 40%
- Technology = 60%
This helps stakeholders understand which categories, products, or regions contribute most to overall performance.
Rank
Ranking is one of the most common business requirements.
For example:
| Product | Sales Rank |
|---|---|
| Product A | 1 |
| Product B | 2 |
| Product C | 3 |
Using the Rank Table Calculation, analysts can quickly identify top-performing products, customers, or regions.
Difference From
This calculation compares a value with a previous value.
For example:
| Month | Sales | Difference |
|---|---|---|
| January | 100 | - |
| February | 150 | 50 |
| March | 200 | 50 |
This is useful for month-over-month performance analysis.
Percent Difference
Percent Difference measures the rate of change between values and is useful for identifying growth or decline over time.
One useful feature of Tableau's Percent Difference table calculation is the ability to choose what each value is compared against. Users can calculate the percentage difference relative to:
- Previous – compares each value with the one immediately before it.
- Next – compares each value with the one immediately after it.
- First – compares all values against the first value in the partition.
- Last – compares all values against the last value in the partition.
Example using Previous:
| Month | Sales | Difference | % Difference from Previous |
|---|---|---|---|
| January | 100 | - | - |
| February | 150 | 50 | 50% |
| March | 200 | 50 | 33.3% |
Understanding Compute Using.
Tableau needs to know how to perform the calculation across the data. For example, a running total can be calculated:
- Across months
- Across products
- Across regions
Selecting the correct Compute Using option ensures that Tableau performs the calculation in the intended direction.
When using specific dimensions, Tableau partitions the data by the unselected dimensions and performs the table calculation across the selected dimensions.
- Selected dimensions = addressing dimensions → Tableau calculates across these dimensions.
- Unselected dimensions = partitioning dimensions → Tableau keeps each unique combination of these dimensions as a separate group.
Advantages of Table Calculations
Table Calculations offer several benefits:
- Easy to create directly within Tableau.
- No modification of the data source is required.
- Ideal for trend analysis and performance tracking.
- Useful for rankings and percentage calculations.
- Enable quick business insights without complex data preparation.
When Should You Use Table Calculations?
Table Calculations are most useful when the calculation depends on the data currently displayed in the view.
Examples include:
- Running totals
- Rankings
- Percent of total
- Month-over-month comparisons
- Growth analysis
- Moving averages
If you need calculations that remain consistent across views, Level of Detail (LOD) expressions may be a better option.
Conclusion
Table Calculations are one of Tableau's most valuable features for creating meaningful business insights. They allow analysts to perform calculations on displayed data, enabling them to analyse trends, rankings, percentages, and growth patterns without altering the underlying dataset.
Understanding how Table Calculations work, especially the Compute Using concept, is essential for building effective, accurate dashboards.
Thank you for reading!
