0
0
Tableaubi_tool~7 mins

LOD vs table calculations in Tableau - Compared

Choose your learning style9 modes available
Introduction
This feature helps you understand the difference between LOD expressions and table calculations in Tableau. It solves the problem of choosing the right method to calculate values at different levels of detail or order in your data visualization.
When you want to calculate a value ignoring the view's current filters or dimensions, like total sales per customer regardless of the current chart grouping.
When you need to compute running totals or moving averages that depend on the order of rows in your table.
When you want to fix a calculation at a specific level, such as average sales per region even if the view shows data by city.
When you want to calculate percent of total based on the displayed data in the current view.
When you need to compare values across different levels of detail without duplicating data.
Steps
Step 1: Open
- Tableau Desktop and load your data source
Your data appears in the Data pane on the left side
Step 2: Create a new calculated field
- Data pane → right-click → Create Calculated Field
A calculation editor window opens
Step 3: Type an LOD expression like { FIXED [Customer]: SUM([Sales]) }
- Calculation editor
The calculation fixes sales sum per customer regardless of view filters
💡 Use curly braces and keywords FIXED, INCLUDE, or EXCLUDE for LOD expressions
Step 4: Drag the new LOD calculated field to Rows or Columns shelf
- Worksheet view
The chart updates showing sales fixed at customer level
Step 5: Create another calculated field for table calculation like RUNNING_SUM(SUM([Sales]))
- Data pane → right-click → Create Calculated Field
A calculation that sums sales cumulatively in the table
Step 6: Drag the table calculation field to the view
- Worksheet view
The chart updates showing running total of sales based on table order
Step 7: Right-click the table calculation field → Edit Table Calculation to adjust addressing and partitioning
- Marks card or shelf
You can control how the calculation moves across rows or columns
Before vs After
Before
View shows total sales by region and city with no special calculations
After
View shows sales fixed per customer using LOD and running total of sales using table calculation
Settings Reference
LOD Expression Types
📍 Calculation editor when writing calculated fields
Controls how the level of detail is fixed or adjusted relative to the view
Default: No default, user defines
Table Calculation Compute Using
📍 Edit Table Calculation dialog
Defines the direction and scope of the table calculation
Default: Table (Across)
Restarting Every
📍 Edit Table Calculation dialog
Sets where the table calculation resets its calculation
Default: None
Common Mistakes
Using LOD expressions when a running total or order-based calculation is needed
LOD expressions ignore table order and cannot compute running totals
Use table calculations like RUNNING_SUM for order-dependent calculations
Using table calculations to fix values at a different level of detail
Table calculations depend on the current view and cannot fix aggregation levels independently
Use LOD expressions with FIXED to calculate values independent of the view
Not adjusting the Compute Using setting for table calculations
Table calculations may produce incorrect results if addressing and partitioning are wrong
Edit Table Calculation and set Compute Using to the correct dimensions
Summary
LOD expressions fix calculations at specific data levels regardless of view filters or dimensions.
Table calculations compute values based on the order and layout of data in the current view.
Choose LOD for level of detail control and table calculations for order-dependent computations.