Skip to main content
Albero Academy

Tableau LOD Expressions

Master FIXED, INCLUDE, and EXCLUDE — the most-asked Tableau interview topic and the key to advanced calculated fields.

Chapter 2Tableau14 min readBeginner friendly
  • #Tableau
  • #LOD
  • #Calculations

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

Tableau · calc
// 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:

Text
[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.

Text
// 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 view
AVG({ INCLUDE [Customer] : SUM([Sales]) })

EXCLUDE — coarser detail

Text
// 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 filter
SUM([Sales]) / { EXCLUDE [Region] : SUM([Sales]) }

Filters & order of operations

This is the part that confuses everyone. Tableau filters apply in this order:

StepWhat runs
1Extract filters
2Data source filters
3Context filters
4FIXED LODs
5Dimension filters
6INCLUDE / EXCLUDE LODs
7Measure filters

Real-world patterns

1. % of total — even with filters

Text
SUM([Sales]) / { FIXED : SUM([Sales]) } // share of grand total

2. New vs returning customers

Text
// Boolean — was this their first order?
[Order Date] = { FIXED [Customer] : MIN([Order Date]) }

3. Cohort analysis — customer's first month bucket

Text
DATETRUNC('month', { FIXED [Customer] : MIN([Order Date]) })

4. Average daily revenue per region

Text
AVG({ INCLUDE [Order Date] : SUM([Sales]) })

Key takeaways

  1. 01FIXED ignores the view; INCLUDE adds finer grain; EXCLUDE removes a dimension.
  2. 02FIXED runs before dimension filters — use Context filters to influence it.
  3. 03FIXED [Customer]: MIN([Order Date]) is the canonical 'first-order date' pattern.
  4. 04Wrap an INCLUDE in AVG/SUM/etc. to aggregate the per-row results.
  5. 05When in doubt: write the FIXED first, then layer INCLUDE/EXCLUDE if needed.