Level of Detail (LOD) expressions are among the most powerful and most misunderstood features in Tableau. Here is a practical guide to FIXED, INCLUDE, and EXCLUDE with real-world use cases.
The quick answer
Level of Detail (LOD) expressions allow you to compute aggregations at a granularity different from the view's level of detail — without changing the view structure or using table calculations. There are three types: FIXED (compute at a specified dimension granularity regardless of view), INCLUDE (compute at the view's level of detail plus additional specified dimensions), and EXCLUDE (compute at the view's level of detail minus specified dimensions). LOD expressions solve a specific class of analytical problems — comparing individual-level data to aggregated baselines, computing cohort metrics, and building per-entity calculations that are independent of how the view is filtered.
Why LOD expressions exist
In Tableau, a worksheet's level of detail is determined by the dimensions in the view — the combination of dimensions on rows, columns, color, size, and detail mark. Every measure is aggregated at that granularity.
The problem LOD expressions solve: what happens when you need a calculation at a different granularity than the view? If your view shows sales by product and region, and you want to compare each row's sales to the total for that region (regardless of product), you need the regional total — but the view is at product-region granularity, not region granularity.
Without LOD expressions, this requires either restructuring the view or writing complex table calculations with WINDOW_SUM. LOD expressions let you specify the granularity of the calculation explicitly and independently of the view.
FIXED
FIXED computes an aggregation at a specified set of dimensions, entirely independently of the view. Filters applied to the view (except context filters and data source filters) do not change the FIXED calculation's result. The syntax is: {FIXED [dimension1], [dimension2] : AGG([measure])}.
**Example — total sales per region**: {FIXED [Region] : SUM([Sales])} returns the total sales for each region, regardless of what other dimensions are in the view. If the view shows sales by product and region, this FIXED expression returns the regional total for each row — not the product-region total.
**Example — first order date per customer**: {FIXED [Customer ID] : MIN([Order Date])} returns the first order date for each customer. Use this to compute customer tenure, days-since-first-order, or new vs returning customer flags.
**Example — cohort size**: {FIXED [Customer ID] : COUNTD([Order ID])} returns the number of distinct orders per customer. Wrap this in a calculated field to segment customers by order frequency.
**FIXED and filters**: FIXED expressions ignore most dimension filters — adding or removing a product filter does not change the FIXED regional total. This is the most commonly misunderstood behaviour. To make a FIXED expression respect a dimension filter, the filter must be elevated to a context filter (right-click the filter card, "Add to Context"). Data source filters and context filters always apply to FIXED.
**FIXED with multiple dimensions**: {FIXED [Region], [Category] : SUM([Sales])} computes total sales for each region-category combination. Use multiple dimensions in FIXED when the base rate you want to compare against is defined by multiple dimensions.
INCLUDE
INCLUDE adds dimensions to the view's level of detail for the calculation, then aggregates back to the view's level. The syntax is: {INCLUDE [dimension] : AGG([measure])}.
INCLUDE is used when you need an intermediate aggregation that is more granular than the view, then aggregate that intermediate result. The classic use case: average sales per customer, broken down by region.
**Example — average sales per customer per region**: if the view shows average customer sales by region, you cannot simply use AVG([Sales]) — that averages all transactions, not all customers. You need: first compute total sales per customer, then average those per-customer totals by region.
Step 1: {INCLUDE [Customer ID] : SUM([Sales])} — computes total sales per customer at each row (within the view's regional level, but adding customer granularity). Step 2: use this expression as the basis of an AVG: {FIXED [Region] : AVG({INCLUDE [Customer ID] : SUM([Sales])})}. Or simply place the INCLUDE expression on the view and let Tableau aggregate it.
**INCLUDE and view filters**: unlike FIXED, INCLUDE respects the view's dimension filters. If you filter the view to one region, the INCLUDE calculation applies within that region.
EXCLUDE
EXCLUDE removes dimensions from the view's level of detail for the calculation. The syntax is: {EXCLUDE [dimension] : AGG([measure])}.
EXCLUDE is used when you want to compute a baseline that ignores one of the view's dimensions. The typical use case: showing each row's value alongside a benchmark that excludes one of the view dimensions.
**Example — percentage of category total**: the view shows sales by product and category. For each product, you want its sales as a percentage of its category total. The category total should not include the product dimension: {EXCLUDE [Product] : SUM([Sales])} returns the category total (ignoring the product split). Divide each product's sales by this excluded total to get the percentage.
**Example — trend against overall average**: the view shows monthly sales by region. You want each region-month cell to show its deviation from the overall monthly average (not the regional monthly average). {EXCLUDE [Region] : AVG([Sales])} returns the average across all regions for each month — the benchmark to compare against.
**EXCLUDE vs table calculations**: EXCLUDE is often compared to WINDOW_AVG or WINDOW_SUM table calculations, which also compute across parts of the view. The key difference: LOD expressions are computed in the data engine (before rendering), while table calculations are computed in the Tableau rendering layer. LOD expressions are generally more performant and easier to understand.
LOD expressions and filters
Understanding how each LOD type interacts with filters is critical to using them correctly:
**FIXED**: ignores dimension filters (except context filters and data source filters). Use context filters to make FIXED respect specific dimension filters.
**INCLUDE**: respects all view filters. Behaves like a regular calculation in terms of filter behaviour, just at a more granular level.
**EXCLUDE**: respects all view filters except those on the excluded dimension. If you EXCLUDE [Region] and then add a Region filter, the EXCLUDE expression does not see the Region filter — it still computes across all regions. This is often the intended behaviour for benchmarking.
Nesting LOD expressions
LOD expressions can be nested — a FIXED expression can reference the result of another LOD expression as its measure. This enables multi-step aggregation pipelines: compute a per-customer total with INCLUDE, then average those totals with FIXED. Nesting depth beyond 2 levels usually indicates that a data model change would be simpler and more performant.
Performance considerations
LOD expressions with FIXED at a high-cardinality dimension (e.g., customer ID in a 10M-customer dataset) generate large intermediate result sets. For performance-sensitive workbooks:
- Test LOD query performance in the Query Profile (Tableau Desktop or Server)
- Consider whether the calculation can be pushed into the data model (a dbt calculated column or materialised view) rather than computed in Tableau on every render
- For large datasets, materialising FIXED calculations as data source columns (compute once in SQL or dbt, consume directly in Tableau) is often significantly more performant than computing them as LOD expressions at render time
For the broader Tableau calculated field context, see tableau calculated fields. For Tableau Server performance optimisation, see tableau server admin guide. For Tableau data source architecture, see tableau data sources guide.
Our Tableau consulting practice builds and optimises complex Tableau workbooks — including LOD expression design, performance tuning, and data model restructuring. Book a free 30-minute audit if your Tableau workbooks have calculation complexity or performance issues.
A former Microsoft data architect audits your data foundation, identifies your top priorities, and sends you a written plan. Free. No pitch.
Book a Call →