01 / 21

Understanding
LOD Expressions

Master Level of Detail expressions in Tableau: control exactly which dimensions participate in your calculations, independent of your view.

Tableau

What is Level of Detail?

In Tableau, the level of detail (LOD) of your view is determined by the dimensions on Rows, Columns, and the Marks card. Every time you add or remove a dimension, you change the granularity of the data.

The Granularity Problem

Order-Level View Order Customer Sales #1001 Alice $120 #1002 Alice $80 #1003 Bob $200 #1004 Bob $150 4 rows (fine grain) Customer-Level View Customer Sales Alice $200 Bob $350 2 rows (coarse grain)

Sometimes you need a calculation at a different granularity than the view shows. For example: you want to see each order, but also know each customer's total. Regular aggregations can't mix levels.

Why LOD Expressions Exist

1
Regular aggregations are view-dependent. SUM(Sales) always aggregates at whatever level of detail is in your view.
2
Table calculations are limited. They can compute across the view, but can't reach a different granularity easily.
3
LOD expressions are view-independent. They let you specify exactly which dimensions to aggregate by, regardless of the view.

The Three LOD Types

FIXED
Computes at exactly the dimensions you specify: ignores the view entirely.
INCLUDE
Adds dimensions to the view's level of detail: computes at a finer grain.
EXCLUDE
Removes dimensions from the view's level of detail: computes at a coarser grain.

LOD Expression Syntax

// General pattern:
{ FIXED | INCLUDE | EXCLUDE
  [Dimension1], [Dimension2], ... :
  AGG(measure) }
// Example: total sales per customer, regardless of view
{ FIXED [Customer Name] : SUM([Sales]) }

Deep Dive: FIXED

View Dimensions [Region] [Category] [Sub-Category] 3 dimensions in view ✕ IGNORES FIXED Expression [Customer Name] SUM([Sales]) Only uses Customer ignores Region, Category, etc.

Deep Dive: INCLUDE

View Dimensions [Region] + ADDS TO INCLUDE Result [Region] [Customer] (added) Computes per Region + per Customer Finer grain than the view

Deep Dive: EXCLUDE

View Dimensions [Region] [Category] (removed) − REMOVES EXCLUDE Result [Region] Computes per Region only (Category removed) Coarser grain than the view

LOD vs Table Calculations

LOD Expressions Table Calculations
Computed where? Data source (query level) Locally in Tableau (after query)
Granularity control You specify dimensions Depends on view layout
Filter interaction Computed before dimension filters Computed after all filters
Use case Cross-level comparisons Running totals, ranks, moving averages
Syntax { FIXED [Dim] : AGG(Measure) } WINDOW_SUM(), RUNNING_TOTAL()

When to Use Each Type

FIXED
Customer lifetime value, cohort analysis, values that must not change when you drill down or filter.
INCLUDE
Average order size per customer (in a region view), min/max per sub-group, then aggregate up.
EXCLUDE
Percent of parent total, comparing a category's sales to the overall region total.

How to Write an LOD Expression

1
Identify the question. What value do you need, and at what level of detail?
2
Compare to the view. Is the desired LOD finer, coarser, or independent of the view?
3
Choose the keyword. Independent = FIXED. Finer = INCLUDE. Coarser = EXCLUDE.
4
List the dimensions. Only the ones needed for the computation.
5
Choose the aggregation. SUM, AVG, MIN, MAX, COUNTD, etc.

Example 1: Customer Total

Goal: Show each order, but also display the customer's total sales across all orders.

// Customer total: independent of view
{ FIXED [Customer Name] : SUM([Sales]) }

Example 2: Average Order Size

Goal: View shows regions. You want the average order size per customer, then average those across the region.

// Step 1: compute per customer (finer than region)
{ INCLUDE [Customer Name] : AVG([Sales]) }

Example 3: Percent of Total

Goal: View shows Region + Category. You want each category's sales as a percentage of its region's total.

// Region total (removes Category from view)
{ EXCLUDE [Category] : SUM([Sales]) }

// Percent of region:
SUM([Sales]) / ATTR(
  { EXCLUDE [Category] : SUM([Sales]) }
)

Common Mistakes

✕ Wrapping LOD in AGG
Writing SUM({ FIXED ... }) when the LOD already returns an aggregate. Use ATTR() or match the outer aggregation intentionally.
✕ Confusing FIXED with INCLUDE
FIXED ignores the view; INCLUDE extends it. Choosing FIXED when you meant "view + extra dimension" gives unexpected results.
✕ Ignoring Filter Order
FIXED LODs are computed before dimension filters. If you filter to one region, a FIXED [Customer] expression still sees all regions unless you use context filters.

Summary Comparison

FIXED INCLUDE EXCLUDE
Relation to view Independent Adds dimensions Removes dimensions
Granularity Exactly as specified Finer than view Coarser than view
Filter behavior Before dim filters After dim filters After dim filters
Typical use Cohorts, totals Avg of sub-groups Percent of parent
Example { FIXED [Cust] : SUM } { INCLUDE [Cust] : AVG } { EXCLUDE [Cat] : SUM }

Question 1 of 5

What does "level of detail" refer to in Tableau?

Question 2 of 5

Which LOD keyword computes at exactly the dimensions you specify, ignoring the view?

Question 3 of 5

Your view shows [Region] and [Category]. You write:
{ EXCLUDE [Category] : SUM([Sales]) }
At what level does this compute?

Question 4 of 5

A key difference between LOD expressions and table calculations is:

Question 5 of 5

You want to compute the average sales per customer while your view only shows [Region]. Which approach is correct?