Bird
Raised Fist0
Tableaubi_tool~15 mins

Custom table calculation scope in Tableau - Deep Dive

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Overview - Custom table calculation scope
What is it?
Custom table calculation scope in Tableau defines which data points are included when performing calculations across a table. It controls the direction and extent of calculations like running totals or percent of total. This helps tailor calculations to specific rows, columns, or the entire table. Without it, calculations might not reflect the intended grouping or order.
Why it matters
Without controlling calculation scope, your results can be misleading or incorrect, causing wrong business decisions. For example, a running total might reset unexpectedly or aggregate unrelated data. Custom scope lets you precisely define how Tableau processes data, ensuring accurate insights and trustworthy dashboards.
Where it fits
Before learning custom table calculation scope, you should understand basic Tableau calculations and how data is structured in views. After mastering scope, you can explore advanced table calculations, level of detail expressions, and parameter-driven dynamic calculations.
Mental Model
Core Idea
Custom table calculation scope tells Tableau exactly which parts of the table to include when doing calculations, shaping how results flow across rows and columns.
Think of it like...
Imagine painting a fence: the scope is like deciding whether you paint one panel, a whole side, or the entire fence. The area you choose changes the final look.
┌───────────────┐
│   Table View  │
├───────────────┤
│ Row 1 │ Row 2 │
│ Col A │ Col B │
└───────────────┘

Scope options:
- Table (Across): includes all rows and columns
- Table (Down): includes all rows in each column
- Pane (Across): includes rows within a pane horizontally
- Pane (Down): includes rows within a pane vertically
- Cell: single data point only
Build-Up - 7 Steps
1
FoundationUnderstanding basic table calculations
🤔
Concept: Introduce what table calculations are and how they operate on data in Tableau views.
Table calculations are computations applied to the data already in your view, like running totals or moving averages. They work on the displayed data, not the raw data source. By default, Tableau calculates across the entire table, but this can be changed.
Result
Learners see how simple calculations like running total sum values across all rows.
Understanding that table calculations work on the displayed data, not the original data, is key to controlling their behavior.
2
FoundationWhat is calculation scope in Tableau?
🤔
Concept: Explain the idea of scope as the set of data points included in a calculation.
Scope defines which data points Tableau includes when performing a calculation. For example, a running total can sum across all rows or reset per category. Scope controls this inclusion, affecting the calculation's result.
Result
Learners grasp that changing scope changes which data points are summed or compared.
Knowing that scope controls the calculation's data boundary helps avoid unexpected results.
3
IntermediateExploring default scope directions
🤔Before reading on: do you think Tableau calculates running totals by default across rows, columns, or the whole table? Commit to your answer.
Concept: Show default scope directions like Table (Across) and Table (Down) and their effects.
Tableau defaults to calculating across the table horizontally (Table Across) or vertically (Table Down). For example, a running total Table Across sums values left to right across columns, while Table Down sums top to bottom down rows.
Result
Learners see how changing direction changes the running total's shape.
Understanding default directions clarifies why calculations behave differently in row vs column layouts.
4
IntermediateUsing panes to limit calculation scope
🤔Before reading on: do you think pane scope resets calculations per pane or continues across panes? Commit to your answer.
Concept: Introduce panes as sub-sections of the table to limit calculation scope.
Panes are smaller groups within the table, like a category or region. Setting scope to Pane (Across) or Pane (Down) limits calculations to within each pane, resetting at pane boundaries. This lets you calculate running totals per group instead of the whole table.
Result
Learners observe running totals restarting for each pane, matching group boundaries.
Knowing how panes segment data helps create group-specific calculations without extra filters.
5
IntermediateCombining scope with addressing and partitioning
🤔Before reading on: do you think addressing fields define scope or partition? Commit to your answer.
Concept: Explain how addressing and partitioning fields define calculation scope and direction.
Addressing fields are the dimensions Tableau moves across when calculating, while partitioning fields define groups where calculations restart. Together, they set the calculation's scope and direction. For example, partitioning by Region and addressing by Month calculates running totals per region across months.
Result
Learners can control calculation flow precisely by choosing addressing and partitioning fields.
Understanding addressing vs partitioning is crucial for mastering custom calculation scope.
6
AdvancedCustomizing scope with Compute Using options
🤔Before reading on: do you think 'Compute Using' changes the data included or just the calculation order? Commit to your answer.
Concept: Teach how 'Compute Using' lets you pick specific dimensions to define scope and direction.
'Compute Using' lets you select exactly which dimensions Tableau uses to compute the calculation. You can pick one or multiple dimensions, changing the scope from entire table to specific rows, columns, or panes. This customizes how calculations like percent of total or running sum behave.
Result
Learners gain fine control over calculation scope by selecting dimensions in 'Compute Using'.
Knowing how to use 'Compute Using' unlocks flexible, precise table calculations tailored to complex views.
7
ExpertAdvanced scope tricks with nested calculations
🤔Before reading on: can nested table calculations have different scopes? Commit to your answer.
Concept: Show how nested calculations can use different scopes to solve complex problems.
You can nest table calculations, each with its own scope. For example, a running total nested inside a percent of total can have different addressing and partitioning. This lets you build multi-step calculations that adapt dynamically to the view's structure.
Result
Learners can create sophisticated calculations that respond to multiple grouping levels.
Understanding nested scopes reveals powerful ways to combine calculations for advanced analytics.
Under the Hood
Tableau processes table calculations after the data is aggregated and placed in the view. It uses the scope settings to determine which cells to include by moving across addressing fields and restarting at partition fields. Internally, it iterates over the data points in the defined order, applying the calculation function step-by-step.
Why designed this way?
Tableau separates aggregation from table calculations to keep data flexible and interactive. The scope design lets users control calculation boundaries without changing the underlying data, supporting dynamic views and multiple calculation types. Alternatives like fixed calculations would reduce flexibility.
┌───────────────┐
│ Aggregated    │
│ Data in View  │
└──────┬────────┘
       │
       ▼
┌───────────────┐
│ Table Calc    │
│ Engine        │
│ (Scope &      │
│ Addressing)   │
└──────┬────────┘
       │
       ▼
┌───────────────┐
│ Calculated    │
│ Results       │
└───────────────┘
Myth Busters - 4 Common Misconceptions
Quick: Does changing the scope affect the original data source? Commit to yes or no.
Common Belief:Changing table calculation scope changes the underlying data in the source.
Tap to reveal reality
Reality:Scope only affects how Tableau processes data already in the view; it does not alter the original data source.
Why it matters:Believing scope changes source data can cause confusion and misuse of data preparation steps.
Quick: Is the default scope always the entire table? Commit to yes or no.
Common Belief:Tableau always calculates table calculations across the entire table by default.
Tap to reveal reality
Reality:Default scope depends on the view layout and can be Table Across, Table Down, Pane, or Cell, not always the entire table.
Why it matters:Assuming default scope is entire table leads to unexpected calculation results and errors.
Quick: Can nested table calculations have independent scopes? Commit to yes or no.
Common Belief:Nested table calculations must share the same scope settings.
Tap to reveal reality
Reality:Each nested calculation can have its own scope, allowing complex multi-level calculations.
Why it matters:Not knowing this limits the ability to build advanced, layered calculations.
Quick: Does partitioning always reset calculations at every dimension? Commit to yes or no.
Common Belief:Partitioning resets calculations at every dimension in the view.
Tap to reveal reality
Reality:Partitioning resets calculations only at the dimensions explicitly set as partition fields, not all dimensions.
Why it matters:Misunderstanding partitioning causes incorrect grouping and calculation errors.
Expert Zone
1
Table calculation scope interacts with sorting and filtering, so changing sort order or filters can silently change calculation results.
2
Addressing and partitioning fields can be dynamically changed using calculated fields or parameters for flexible, user-driven scope control.
3
Nested table calculations with different scopes can cause performance issues if not optimized, especially on large datasets.
When NOT to use
Custom table calculation scope is not suitable when you need row-level calculations before aggregation or when calculations must be fixed regardless of view changes. In such cases, use Level of Detail (LOD) expressions or data source calculations instead.
Production Patterns
Professionals use custom scope to create running totals per category, percent of total per region, or moving averages within time windows. Nested scopes enable complex KPIs combining multiple aggregation layers. Dynamic scope controlled by parameters allows interactive dashboards tailored to user selections.
Connections
Level of Detail (LOD) Expressions
Complementary concept that fixes calculation granularity at data source level, unlike scope which works on aggregated view data.
Understanding scope clarifies when to use table calculations versus LODs for precise control over aggregation levels.
Window Functions in SQL
Similar pattern of defining calculation partitions and order to compute running totals or ranks.
Knowing SQL window functions helps grasp Tableau's addressing and partitioning concepts for table calculations.
Spreadsheet Formulas (e.g., Excel SUMIF)
Both define calculation ranges and conditions, but Tableau scope is dynamic and visual-layout driven.
Comparing helps understand how visual layout influences calculation scope in Tableau versus static ranges in spreadsheets.
Common Pitfalls
#1Calculations reset unexpectedly across groups.
Wrong approach:Running Total with default scope on a view with multiple categories, expecting one total across all categories.
Correct approach:Set partitioning to category dimension so running total resets per category group.
Root cause:Not setting partitioning fields causes Tableau to treat all data as one group, leading to unexpected resets.
#2Calculation ignores intended direction and sums wrong data points.
Wrong approach:Using Table (Down) scope on a view laid out horizontally, expecting horizontal running total.
Correct approach:Change scope to Table (Across) to match horizontal layout for correct running total direction.
Root cause:Mismatch between calculation scope direction and view layout causes incorrect aggregation.
#3Nested calculations produce wrong results due to shared scope settings.
Wrong approach:Applying same scope to both inner and outer table calculations without adjusting addressing and partitioning.
Correct approach:Customize scope separately for each nested calculation to control flow and grouping precisely.
Root cause:Assuming nested calculations share scope leads to incorrect layering and aggregation.
Key Takeaways
Custom table calculation scope controls which data points Tableau includes when performing calculations, shaping results across rows and columns.
Scope is defined by addressing and partitioning fields that determine calculation direction and reset points within the view.
Using panes and 'Compute Using' options lets you tailor calculations to specific groups or directions for accurate insights.
Nested table calculations can have independent scopes, enabling complex multi-level analytics.
Understanding scope prevents common errors like unexpected resets or wrong aggregation, ensuring trustworthy dashboards.

Practice

(1/5)
1. What does the Custom Table Calculation Scope control in Tableau?
easy
A. Which data points are included in the calculation
B. The color scheme of the visualization
C. The font size of labels
D. The data source connection type

Solution

  1. Step 1: Understand the purpose of table calculation scope

    The scope defines which data points Tableau uses when performing calculations like running totals or rankings.
  2. Step 2: Identify what is controlled by scope

    It controls the subset of data included in the calculation, not visual formatting or data source settings.
  3. Final Answer:

    Which data points are included in the calculation -> Option A
  4. Quick Check:

    Scope controls data points included [OK]
Hint: Scope means which data points calculation uses [OK]
Common Mistakes:
  • Confusing scope with visual formatting
  • Thinking scope changes data source
  • Mixing scope with filter settings
2. Which option correctly sets the scope of a table calculation to compute using only the Region dimension in Tableau?
easy
A. Compute Using > Pane (Across)
B. Compute Using > Table (Down)
C. Compute Using > Region
D. Compute Using > Table (Across)

Solution

  1. Step 1: Identify the dimension to set scope

    To limit calculation to the Region dimension, select Compute Using > Region.
  2. Step 2: Understand Compute Using options

    Options like Table (Down) or Table (Across) use the entire table direction, not a specific dimension.
  3. Final Answer:

    Compute Using > Region -> Option C
  4. Quick Check:

    Compute Using dimension name sets scope [OK]
Hint: Choose dimension name under Compute Using for scope [OK]
Common Mistakes:
  • Selecting Table (Down) instead of dimension
  • Confusing Pane with Table scope
  • Not selecting specific dimension
3. Given a sales table with dimensions Region and Category, what will be the result of a running total table calculation with scope set to Compute Using: Category for Region 'West'?
medium
A. Running total sums all data ignoring Region and Category
B. Running total resets for each Category within the West region
C. Running total resets for each Region ignoring Category
D. Running total sums all Categories across all Regions

Solution

  1. Step 1: Understand scope set to Category

    Compute Using Category means the running total computes along the Category dimension, restarting (partitioned) by other dimensions like Region.
  2. Step 2: Consider Region filter 'West'

    Filtered to West, the running total resets for each Category within the West region.
  3. Final Answer:

    Running total resets for each Category within the West region -> Option B
  4. Quick Check:

    Compute Using Category: along Category, reset by Region [OK]
Hint: Compute Using sets addressing (along), partition sets reset [OK]
Common Mistakes:
  • Thinking running total sums all regions
  • Ignoring filter on Region
  • Confusing scope with partitioning
4. You set a table calculation to Compute Using: Table (Across) but the running total is incorrect. What is the most likely cause?
medium
A. The table calculation is not enabled
B. The calculation is missing a filter
C. The data source is not connected
D. The data is arranged vertically, but scope is set horizontally

Solution

  1. Step 1: Analyze Compute Using Table (Across)

    This scope computes calculation across columns (horizontally).
  2. Step 2: Check data arrangement

    If data is arranged vertically (down rows), computing across columns causes incorrect results.
  3. Final Answer:

    The data is arranged vertically, but scope is set horizontally -> Option D
  4. Quick Check:

    Scope direction must match data layout [OK]
Hint: Match Compute Using direction to data layout [OK]
Common Mistakes:
  • Ignoring data layout when setting scope
  • Assuming filters cause running total errors
  • Thinking data source connection affects calculation
5. You want to create a running total of sales that restarts for each Region and sums across Category. Which custom table calculation scope should you use?
hard
A. Compute Using: Category, Restarting every Region
B. Compute Using: Region, Restarting every Category
C. Compute Using: Table (Down)
D. Compute Using: Pane (Across)

Solution

  1. Step 1: Understand requirement

    Running total should sum across Category but restart for each Region.
  2. Step 2: Set scope to Category and partition by Region

    Setting Compute Using to Category calculates running total across categories. Restarting every Region means partitioning by Region.
  3. Step 3: Confirm other options

    Other options do not correctly partition or compute as required.
  4. Final Answer:

    Compute Using: Category, Restarting every Region -> Option A
  5. Quick Check:

    Scope by Category with restart per Region [OK]
Hint: Compute Using dimension to sum, partition to restart [OK]
Common Mistakes:
  • Confusing which dimension to compute using
  • Not setting restart partition correctly
  • Using Table (Down) which sums entire table