5 LOD Calculations in Tableau I Use Every Day
Contents
- What are LOD calculations and why are they needed?
- How LOD differs from Table Calculations
- 1. Customer's first purchase date
- 2. Product share in category — independent of filters
- 3. Average order value per customer, not per transaction
- 4. Percentage of total with an active dimension (EXCLUDE)
- 5. Customer segmentation by total spend (FIXED + IF)
- Order of operations — critical knowledge
- TL;DR
If Tableau frustrates you when you try to calculate "average revenue per customer" and get something that looks like revenue per transaction — you've hit a classic problem that LOD expressions solve in one line.
What are LOD calculations and why are they needed?
In standard Tableau calculations, the aggregation level depends on the current view. If you have month on the X axis and SUM([Revenue]) on Y — Tableau calculates revenue per month. Change the axis to category — it calculates per category.
LOD (Level of Detail) lets you tell Tableau: "calculate this at this specific level, regardless of the view." That's a fundamental difference.
Three types of LOD:
FIXED— calculate at specified dimensions, ignore the current view (used most often)INCLUDE— add a dimension to the current view contextEXCLUDE— remove a dimension from the current view context
How LOD differs from Table Calculations
Table Calculations (LOOKUP, WINDOW_SUM, RANK) work after rendering the view. They only operate on data already visible in the view.
LOD expressions work at query time, before the view renders. They can access data outside the current view.
Simple rule: if you need values that "don't change" when you filter the view — use FIXED LOD.
1. Customer's first purchase date
Classic use case — foundation for cohort analysis, retention, days-to-next-order.
{ FIXED [Customer ID] : MIN([Order Date]) }Name this field First Purchase Date. Then:
DATEDIFF('day', [First Purchase Date], [Order Date])This gives you days elapsed since first purchase for every subsequent order. Visualized by weekly cohort = ready retention chart.
2. Product share in category — independent of filters
Problem: you have a country filter but want to see each product's share of its category globally.
{ FIXED [Category], [Product Name] : SUM([Revenue]) }
/
{ FIXED [Category] : SUM([Revenue]) }FIXED ignores view filters — calculates on the full dataset.
Note: FIXED ignores regular filters but respects Context Filters. To make a filter affect FIXED — right-click the filter → "Add to Context".
3. Average order value per customer, not per transaction
AVG([Order Value]) in Tableau = average transaction value. A customer with 10 orders has 10× more influence than one with one order.
For a true per-customer average:
{ FIXED [Customer ID] : AVG([Order Value]) }Each customer gets one value — their own average. Use for distribution histograms, customer segmentation, or as a filter.
4. Percentage of total with an active dimension (EXCLUDE)
You have a bar chart with categories on X and revenue on Y. You want each bar labeled with its % of total revenue.
SUM([Revenue]) / { EXCLUDE [Category] : SUM([Revenue]) }EXCLUDE [Category] removes the category dimension from the calculation context — computes the sum across all categories. Format as % → ready bar labels.
Known limitation: if you use a calculated field as a dimension (e.g., YEAR([Order Date])), EXCLUDE [Year] may not work. Use the original [Order Date] field or name it in the calculation editor.
5. Customer segmentation by total spend (FIXED + IF)
IF { FIXED [Customer ID] : SUM([Revenue]) } >= 5000
THEN "High Value"
ELSEIF { FIXED [Customer ID] : SUM([Revenue]) } >= 1000
THEN "Mid Value"
ELSE "Standard"
ENDPut this field on Color, Filters, or Rows — it behaves like any other categorical dimension. Works correctly even when the view is at the transaction level, because FIXED computes the sum per customer.
Order of operations — critical knowledge
Tableau has a strict order. FIXED LOD executes before view filters (but after Context Filters and Datasource Filters).
Full order: Extracts → Datasource Filters → Context Filters → Fixed LOD → Dimension Filters → Measure Filters → Include/Exclude LOD → Table Calculations
TL;DR
- LOD = calculate an aggregate at a specific level, regardless of the current view
FIXEDignores view filters (but not Context Filters) — used most oftenEXCLUDEfor percentage shares without changing the view- Typical uses: first purchase date, per-customer averages, segmentation, category share
- Context Filters when you want a filter to affect
FIXED - LOD on Extract = fast; LOD on Live Connection can slow dashboards
Slow dashboards, or nobody using them?
I design Tableau and Holistics dashboards your team actually uses every day. The first call is free.
Book a consultationMore articles about data analytics:
Back to blog