Level of Detail (LOD) expressions let you compute aggregates at a different grain than the view. They're Tableau's superpower — and the topic interviewers ask about most. Once you understand { FIXED }, the rest follows.
Why LOD?
By default, Tableau aggregates to the view's level. If your view shows revenue per region, every measure on the canvas aggregates per region. LOD expressions let you escape that:
- FIXED: aggregate at this fixed level, ignoring the view.
- INCLUDE: aggregate at view-level plus these extra dimensions.
- EXCLUDE: aggregate at view-level minus these dimensions.
FIXED — pin a granularity
// Total sales per region — regardless of what's on the view{ FIXED [Region] : SUM([Sales]) }// Each customer's lifetime spend, even when viewing by month{ FIXED [Customer] : SUM([Sales]) }// First-order date per customer — useful for cohort analysis{ FIXED [Customer] : MIN([Order Date]) }
Example: show each customer's order alongside their total lifetime spend, even on a view broken down by month:
[Order Total] // Sum of this row{ FIXED [Customer] : SUM([Sales]) } // Sum across ALL rows for that customer[% of LTV] = [Order Total] / { FIXED [Customer] : SUM([Sales]) }
INCLUDE — add detail
Computes at a finer grain than the view, then aggregates back up.
// Average customer spend per region// Without INCLUDE: SUM(Sales) / DISTINCT(Customers) — accurate but ugly// With INCLUDE: aggregates per customer first, then averages those{ INCLUDE [Customer] : SUM([Sales]) }// Wrap with AVG to get average per customer — even on a region viewAVG({ INCLUDE [Customer] : SUM([Sales]) })
EXCLUDE — coarser detail
// On a view showing region × month, get the year total ignoring month{ EXCLUDE [Order Date].[Month] : SUM([Sales]) }// Region's share of grand total — independent of region filterSUM([Sales]) / { EXCLUDE [Region] : SUM([Sales]) }
Filters & order of operations
This is the part that confuses everyone. Tableau filters apply in this order:
| Step | What runs |
|---|---|
| 1 | Extract filters |
| 2 | Data source filters |
| 3 | Context filters |
| 4 | FIXED LODs |
| 5 | Dimension filters |
| 6 | INCLUDE / EXCLUDE LODs |
| 7 | Measure filters |
Real-world patterns
1. % of total — even with filters
SUM([Sales]) / { FIXED : SUM([Sales]) } // share of grand total
2. New vs returning customers
// Boolean — was this their first order?[Order Date] = { FIXED [Customer] : MIN([Order Date]) }
3. Cohort analysis — customer's first month bucket
DATETRUNC('month', { FIXED [Customer] : MIN([Order Date]) })
4. Average daily revenue per region
AVG({ INCLUDE [Order Date] : SUM([Sales]) })
Key takeaways
- 01FIXED ignores the view; INCLUDE adds finer grain; EXCLUDE removes a dimension.
- 02FIXED runs before dimension filters — use Context filters to influence it.
- 03FIXED [Customer]: MIN([Order Date]) is the canonical 'first-order date' pattern.
- 04Wrap an INCLUDE in AVG/SUM/etc. to aggregate the per-row results.
- 05When in doubt: write the FIXED first, then layer INCLUDE/EXCLUDE if needed.
