0
0
Tableaubi_tool~15 mins

Compute using (table across, down) in Tableau - Deep Dive

Choose your learning style9 modes available
Overview - Compute using (table across, down)
What is it?
In Tableau, 'Compute Using' controls how table calculations are applied across your data. It tells Tableau the direction to move through the data—either across columns (left to right) or down rows (top to bottom)—to perform calculations like running totals or percent of total. This helps you customize how your numbers are calculated and displayed in your visualizations.
Why it matters
Without understanding 'Compute Using', your calculations might give unexpected results, making your reports confusing or incorrect. It solves the problem of how to apply calculations over rows or columns in a table, so you can answer questions like 'What is the running total across months?' or 'What is the percent of total down categories?'. Without it, you lose control over how your data is summarized and analyzed.
Where it fits
Before learning this, you should know basic Tableau concepts like dimensions, measures, and how to build simple views. After mastering 'Compute Using', you can explore advanced table calculations, level of detail calculations, and dynamic calculations that respond to user interaction.
Mental Model
Core Idea
Compute Using tells Tableau the direction to move through your table to perform calculations, either across columns or down rows.
Think of it like...
It's like reading a book: you can read across the page from left to right or down the page from top to bottom. How you read changes what you understand, just like how Compute Using changes how Tableau calculates numbers.
┌───────────────┬───────────────┬───────────────┐
│ Category      │ Jan           │ Feb           │
├───────────────┼───────────────┼───────────────┤
│ Product A     │ 10            │ 15            │
│ Product B     │ 20            │ 25            │
└───────────────┴───────────────┴───────────────┘

Compute Using: Across → moves left to right across Jan, Feb
Compute Using: Down → moves top to bottom down Product A, Product B
Build-Up - 7 Steps
1
FoundationUnderstanding Table Calculations Basics
🤔
Concept: Table calculations are computations applied to the data in your view after aggregation.
In Tableau, after you create a view with rows and columns, you can add calculations like running totals or percent of total. These calculations work on the displayed data, not the raw data source. For example, a running total sums values step-by-step across or down the table.
Result
You get new numbers that summarize or transform your data based on the table layout.
Understanding that table calculations work on the displayed data helps you see why direction matters for their results.
2
FoundationWhat Does Compute Using Mean?
🤔
Concept: Compute Using defines the direction Tableau uses to perform the calculation over the table.
When you add a table calculation, Tableau guesses how to compute it, but you can change it. 'Compute Using' options include Table Across (left to right), Table Down (top to bottom), Pane Across, Pane Down, and more. Choosing 'Table Across' means Tableau moves across columns; 'Table Down' means it moves down rows.
Result
The calculation changes depending on the direction you choose, affecting your final numbers.
Knowing that Compute Using controls calculation direction lets you tailor results to your question.
3
IntermediateApplying Compute Using Across Columns
🤔Before reading on: If you compute a running total across months, do you expect the total to add values left to right or top to bottom? Commit to your answer.
Concept: Computing across means Tableau moves horizontally through columns to calculate values.
Imagine a sales table with months as columns. Setting Compute Using to 'Table Across' for a running total sums sales from left to right across months for each row (e.g., product). So January is just January's sales, February is January plus February, and so on.
Result
You see cumulative totals growing across the months horizontally.
Understanding horizontal computation helps you analyze trends over time or categories laid out in columns.
4
IntermediateApplying Compute Using Down Rows
🤔Before reading on: If you compute percent of total down categories, do you think Tableau sums values top to bottom or left to right? Commit to your answer.
Concept: Computing down means Tableau moves vertically through rows to calculate values.
With categories as rows and a single measure column, setting Compute Using to 'Table Down' for percent of total calculates each row's value as a percentage of the total sum down the column. Tableau moves top to bottom through rows to compute this.
Result
You get percentages showing each category's share of the total vertically.
Knowing vertical computation lets you compare parts to whole within a column.
5
IntermediateDifference Between Pane and Table Directions
🤔
Concept: Pane directions limit calculation to a section of the table, while Table directions use the entire table.
If your view has multiple panes (like multiple regions), 'Pane Across' computes across columns within each pane only, not the whole table. 'Table Across' ignores pane boundaries and computes across all columns in the table. This controls calculation scope.
Result
Calculations can reset or continue depending on pane boundaries.
Understanding panes helps you control calculation boundaries for more precise analysis.
6
AdvancedCombining Compute Using with Partitioning
🤔Before reading on: Do you think partitioning changes the direction of computation or the groups over which calculation restarts? Commit to your answer.
Concept: Partitioning defines groups where calculations restart; Compute Using defines direction within those groups.
In Tableau, partitioning splits data into groups (like regions), and Compute Using defines how to move inside each group. For example, running total can restart for each region (partition) but compute across months (direction). This combination controls complex calculations.
Result
You get grouped calculations that reset per partition but compute directionally inside.
Knowing partitioning and direction together unlocks powerful, flexible calculations.
7
ExpertUnexpected Effects of Compute Using on Complex Views
🤔Before reading on: Can changing Compute Using cause your calculation to produce completely different results even if the numbers look similar? Commit to your answer.
Concept: Compute Using can drastically change results in multi-dimensional views, sometimes causing confusion.
In views with multiple dimensions on rows and columns, Compute Using direction affects which dimension Tableau moves through first. This can cause running totals or percent calculations to behave unexpectedly if you don't carefully set direction and partitioning. Experts often debug by visualizing the path Tableau takes.
Result
Calculations may seem wrong or inconsistent until direction is correctly set.
Understanding how Tableau navigates complex tables prevents subtle calculation errors in production dashboards.
Under the Hood
Tableau stores the aggregated data in a grid based on the view's layout. When a table calculation runs, Tableau moves through this grid in the direction specified by Compute Using, applying the calculation step-by-step. It uses partitioning to reset calculations at group boundaries. Internally, this is a cursor moving through cells, accumulating or comparing values as defined.
Why designed this way?
Tableau separates data aggregation from table calculations to allow flexible, dynamic computations on the displayed data without changing the underlying data source. Compute Using was designed to give users control over calculation direction because data can be arranged in many ways, and calculations need to adapt accordingly.
┌───────────────┬───────────────┬───────────────┐
│               │ Col 1         │ Col 2         │
├───────────────┼───────────────┼───────────────┤
│ Row 1         │ Cell (1,1)    │ Cell (1,2)    │
│ Row 2         │ Cell (2,1)    │ Cell (2,2)    │
└───────────────┴───────────────┴───────────────┘

Compute Using Across: moves → Cell(1,1) → Cell(1,2) then Cell(2,1) → Cell(2,2)
Compute Using Down: moves ↓ Cell(1,1) → Cell(2,1) then Cell(1,2) → Cell(2,2)

Partitioning resets calculation at pane or dimension boundaries.
Myth Busters - 4 Common Misconceptions
Quick: Does Compute Using change the underlying data or just how calculations are applied? Commit to yes or no.
Common Belief:Compute Using changes the original data values in the source.
Tap to reveal reality
Reality:Compute Using only changes how Tableau calculates on the aggregated data in the view; it does not alter the source data.
Why it matters:Believing this can cause users to fear making changes or misunderstand calculation effects, leading to incorrect data handling.
Quick: If you set Compute Using to Table Across, does Tableau always move left to right regardless of view layout? Commit to yes or no.
Common Belief:Table Across always means left to right movement no matter how the view is arranged.
Tap to reveal reality
Reality:Table Across means moving across the table's columns as arranged in the view, but if columns are swapped or rearranged, the direction changes accordingly.
Why it matters:Misunderstanding this leads to wrong assumptions about calculation direction and unexpected results.
Quick: Does Compute Using affect all calculations in Tableau? Commit to yes or no.
Common Belief:Compute Using applies to every calculation in Tableau.
Tap to reveal reality
Reality:Compute Using only applies to table calculations, not to basic aggregations or calculated fields without table calculation functions.
Why it matters:Confusing this can cause users to waste time trying to set Compute Using on calculations where it has no effect.
Quick: Can Compute Using cause calculations to restart at certain points? Commit to yes or no.
Common Belief:Compute Using controls where calculations restart.
Tap to reveal reality
Reality:Partitioning controls where calculations restart; Compute Using controls the direction within partitions.
Why it matters:Mixing these up leads to incorrect calculation setup and confusing results.
Expert Zone
1
Compute Using direction can interact subtly with table layout changes, causing calculations to break silently if the view is rearranged.
2
Partitioning and addressing fields in Compute Using can be customized independently, allowing complex multi-dimensional calculations.
3
Tableau's default Compute Using guesses often work but can fail in complex views, so experts always verify and adjust direction explicitly.
When NOT to use
Avoid relying solely on Compute Using for complex aggregations that require data source level calculations or when performance is critical; instead, use Level of Detail (LOD) expressions or data source calculations.
Production Patterns
Professionals use Compute Using to create running totals, moving averages, percent of total, and rank calculations in dashboards. They combine it with parameter controls to let users switch calculation directions dynamically.
Connections
Matrix Multiplication
Both involve moving through rows and columns systematically to compute results.
Understanding how Compute Using moves through table cells is similar to how matrix multiplication accesses elements row-wise or column-wise, helping grasp directional computation.
Spreadsheet Formulas (Excel)
Compute Using is like choosing whether to copy formulas across columns or down rows in Excel.
Knowing how Excel formulas fill across or down helps understand how Tableau applies calculations directionally.
Reading Direction in Languages
Compute Using direction parallels reading direction in languages (left-to-right vs top-to-bottom).
Recognizing this connection helps appreciate why direction matters in processing information, whether text or data.
Common Pitfalls
#1Calculation results look wrong because Compute Using direction is not set correctly.
Wrong approach:RUNNING_SUM(SUM([Sales])) with default Compute Using (automatic) in a view with months on rows and products on columns.
Correct approach:RUNNING_SUM(SUM([Sales])) with Compute Using set explicitly to Table Down to sum sales down months for each product.
Root cause:Relying on Tableau's automatic Compute Using guess without verifying direction causes unexpected calculation paths.
#2Calculations restart unexpectedly because partitioning is confused with Compute Using.
Wrong approach:Setting Compute Using to Table Across expecting calculation to restart per region, but partitioning is not set.
Correct approach:Set partitioning to Region and Compute Using to Table Across to restart calculation per region and compute across months.
Root cause:Misunderstanding that partitioning controls restart points, not Compute Using.
#3Trying to use Compute Using on a simple aggregation expecting it to change results.
Wrong approach:SUM([Sales]) with Compute Using set to Table Down.
Correct approach:Use a table calculation function like RUNNING_SUM(SUM([Sales])) to apply Compute Using direction.
Root cause:Not realizing Compute Using only affects table calculations, not basic aggregations.
Key Takeaways
Compute Using controls the direction Tableau moves through your table to perform calculations, either across columns or down rows.
It only affects table calculations, which operate on aggregated data in the view, not the raw data source.
Partitioning and Compute Using work together: partitioning defines groups where calculations restart, Compute Using defines direction within those groups.
Choosing the correct Compute Using direction is essential to get accurate and meaningful calculation results in your visualizations.
Experts always verify and adjust Compute Using settings explicitly, especially in complex views, to avoid subtle calculation errors.