One of Tableau’s most powerful features is its ability to analyze data at different levels of detail.
For example, you may want to answer questions such as:
- What is the average sales per customer?
- What percentage does each product contribute to total sales?
- What is the total revenue per region regardless of filters in the view?
- How does an individual order compare to overall company performance?
Standard Tableau calculations often depend on the dimensions currently displayed in a visualization. However, business questions frequently require calculations at a different level of granularity.
This is where Level of Detail (LOD) Expressions become valuable.
LOD expressions allow you to calculate values at a specific level of detail, independent of the visualization itself.
In this guide, you’ll learn how Tableau LOD expressions work and how to use FIXED, INCLUDE, and EXCLUDE calculations effectively.
What Are LOD Expressions?
Level of Detail (LOD) Expressions in Tableau allow calculations to be performed at a specific level of granularity, regardless of the dimensions currently displayed in a visualization. The three primary types are FIXED, INCLUDE, and EXCLUDE.
Normally, Tableau calculates metrics based on the dimensions present in the view.
Example:
| Region | Sales |
|---|---|
| North | 100,000 |
| South | 120,000 |
If Region is displayed, Tableau aggregates sales by region.
However, sometimes you need calculations at a different level.
For example:
View Level:
Region
Calculation Level:
Customer
LOD expressions allow this separation.
Why LOD Expressions Matter
Business users often need calculations that standard aggregations cannot provide easily.
Examples include:
- Customer lifetime value
- Average sales per customer
- Regional contribution percentages
- Order-level profitability
- Company-wide benchmarks
LOD expressions make these analyses possible without restructuring data.
Understanding Granularity
Granularity refers to the level of detail in a dataset.
Example:
Order Level
↓
Customer Level
↓
Region Level
↓
Country Level
Each level represents a different degree of aggregation.
LOD expressions control where calculations occur within this hierarchy.
Types of LOD Expressions
Tableau provides three main LOD expression types:
FIXED
Calculates at a specified level regardless of the view.
INCLUDE
Adds dimensions to the current level of detail.
EXCLUDE
Removes dimensions from the current level of detail.
Each serves a different analytical purpose.
FIXED LOD Expressions
FIXED is the most commonly used LOD expression.
Syntax:
{ FIXED [Dimension] : Aggregate Calculation }
Example:
{ FIXED [Region] : SUM([Sales]) }
This calculates total sales for each region regardless of what appears in the visualization.
FIXED Example
Dataset:
| Region | Customer | Sales |
|---|---|---|
| North | A | 100 |
| North | B | 200 |
| South | C | 300 |
LOD:
{ FIXED [Region] : SUM([Sales]) }
Results:
| Region | Regional Sales |
|---|---|
| North | 300 |
| South | 300 |
The calculation remains tied to Region even if Customer is displayed.
When to Use FIXED
FIXED is useful for:
- Regional totals
- Customer lifetime value
- Company-wide benchmarks
- Percentage-of-total calculations
- Target comparisons
It provides consistent aggregation levels.
INCLUDE LOD Expressions
INCLUDE adds dimensions to the existing view.
Syntax:
{ INCLUDE [Dimension] : Aggregate Calculation }
Example:
{ INCLUDE [Customer] : SUM([Sales]) }
This adds Customer granularity to calculations.
INCLUDE Example
Suppose your visualization displays:
Region
but you need:
Average Customer Sales
LOD:
{ INCLUDE [Customer] : SUM([Sales]) }
This enables customer-level calculations while maintaining region-level reporting.
When to Use INCLUDE
Common use cases:
- Average sales per customer
- Average profit per order
- Customer-level metrics
- Detailed performance analysis
INCLUDE is ideal when you need more granular calculations than the current view.
EXCLUDE LOD Expressions
EXCLUDE removes dimensions from calculations.
Syntax:
{ EXCLUDE [Dimension] : Aggregate Calculation }
Example:
{ EXCLUDE [Customer] : SUM([Sales]) }
This ignores Customer even if it appears in the visualization.
EXCLUDE Example
View:
| Region | Customer | Sales |
|---|---|---|
| North | A | 100 |
| North | B | 200 |
LOD:
{ EXCLUDE [Customer] : SUM([Sales]) }
Result:
| Region | Regional Sales |
|---|---|
| North | 300 |
Customer-level differences are removed from the calculation.
When to Use EXCLUDE
Useful for:
- Regional benchmarks
- Overall averages
- Percent-of-total metrics
- Comparison calculations
EXCLUDE helps simplify calculations when the view contains unnecessary detail.
Understanding Calculation Context
A common challenge is understanding where calculations occur.
Standard aggregation:
View Dimensions
↓
Calculation
LOD calculation:
Specified Granularity
↓
Calculation
↓
Visualization
This distinction is what makes LOD expressions powerful.
Example: Customer Lifetime Value
Dataset:
| Customer | Sales |
|---|---|
| A | 100 |
| A | 150 |
| B | 300 |
LOD:
{ FIXED [Customer] : SUM([Sales]) }
Results:
| Customer | Lifetime Value |
|---|---|
| A | 250 |
| B | 300 |
The calculation aggregates all purchases for each customer.
Example: Percentage of Total Sales
LOD:
SUM([Sales]) /
{ FIXED : SUM([Sales]) }
This compares individual sales values against company-wide totals.
Common use cases include:
- Market share
- Revenue contribution
- Product performance
Example: Average Sales per Customer
Calculation:
AVG(
{ FIXED [Customer] :
SUM([Sales])
}
)
This determines average customer spending.
Business teams often use this metric for customer analysis.
FIXED vs INCLUDE vs EXCLUDE
| Type | Purpose |
|---|---|
| FIXED | Calculate at a specific level |
| INCLUDE | Add more detail |
| EXCLUDE | Remove detail |
Choosing the right option depends on the business question.
Real-World Use Cases
Sales Analytics
Calculate regional performance.
Customer Analytics
Measure customer lifetime value.
Marketing Dashboards
Analyze campaign contribution.
Financial Reporting
Create department-level benchmarks.
Operations Reporting
Compare individual transactions against organizational averages.
LOD Expressions and Filters
Understanding filters is important.
FIXED calculations generally occur before most dimension filters.
This can produce unexpected results for beginners.
Example:
Filter Applied
↓
Calculation May Not Change
because the FIXED expression is evaluated earlier.
Always test filter behavior carefully.
Common Beginner Mistakes
Using the Wrong LOD Type
FIXED, INCLUDE, and EXCLUDE serve different purposes.
Ignoring Granularity
Always understand the level where calculations occur.
Overcomplicating Calculations
Simple LOD expressions are easier to maintain.
Forgetting Filter Context
Filters can affect calculations differently than expected.
Not Validating Results
Always verify outputs against known values.
Best Practices
Start with FIXED
It is typically the easiest LOD type to understand.
Use Descriptive Names
Name calculated fields clearly.
Test Incrementally
Build and validate calculations step by step.
Document Complex Logic
Future users should understand calculation behavior.
Keep Calculations Simple
Avoid unnecessary complexity when possible.
Why LOD Expressions Are Powerful
Before LOD expressions, many advanced calculations required:
- Data restructuring
- Complex joins
- Multiple worksheets
LOD expressions allow analysts to create sophisticated calculations directly within Tableau.
This reduces development effort and improves flexibility.
Level of Detail (LOD) Expressions are one of Tableau’s most powerful analytical features. They allow calculations to occur at a specific level of granularity regardless of what is displayed in a visualization.
By understanding FIXED, INCLUDE, and EXCLUDE expressions, analysts can create more accurate metrics, answer complex business questions, and build more insightful dashboards.
For anyone working seriously with Tableau, mastering LOD expressions is an essential skill.
FAQ
What is an LOD expression in Tableau?
An LOD expression allows calculations to be performed at a specified level of detail independent of the current visualization.
What are the three types of LOD expressions?
The three main types are FIXED, INCLUDE, and EXCLUDE.
When should I use FIXED?
Use FIXED when calculations must always occur at a specific granularity.
What does INCLUDE do?
INCLUDE adds dimensions to the current level of detail.
What does EXCLUDE do?
EXCLUDE removes dimensions from calculations while keeping them visible in the view.