🚀 New batches open: Advanced Excel • Power BI • SQL • AI for Analytics — Book a free demo

Day 7 — Level of Detail - the FIXED expression

The feature that separates people who use Tableau from people who know Tableau.

The problem LODs solve

Every number in a Tableau view is computed at the level of detail of that view. Break the view down by Region and every measure is per region. Usually that is exactly right - until you need a number from a different level in the same view.

"What share of total sales is this region?" needs two levels at once: this region’s sales, and everything’s sales.

Every calculation on this page runs against the Orders data source below - 48 rows, dimensions in blue, measures in green, exactly as Tableau colours them.

FIXED ignores the view

{ FIXED dimension : aggregate }

Read it as: whatever the view is doing, group by this and compute that.

This is the percent-of-total pattern {FIXED : SUM([Sales])} with no dimension after FIXED means "the whole data source". It returns 30,37,800 on every row, whatever the view is broken down by. Divide one by the other and the shares add to 1.

FIXED with a dimension

The two match on every row, because the view is already grouped by Region. The Grand Total matches as well - SUM around an LOD adds up the four region values, not the 48 row values.

Why the SUM around the LOD An LOD is worked out at its own level first, then aggregated. Without the wrapper, a view showing several regions at once has four different answers and no way to choose - which is exactly the error further down this page.

They part company the moment the view sits at a different level. The same expression, broken down by Category instead:

The second column reads 30,37,800 on both rows The FIXED groups by Region and ignores the Category the view is showing, so each row gets every region’s full total, across both categories. That is not a mistake - it is the defining behaviour of FIXED, and the reason it can produce a whole-dataset number inside a filtered view.

Why FIXED is different from a plain aggregate

The middle column refuses to change as the view changes. That is the whole point - it is computed against the data source, not against the rows the view happens to be showing.

A FIXED that spans several groups

That fails, and the message explains why: with no Region in the view, the expression produces four different numbers and Tableau does not know which one you meant. Wrapping it in an aggregate resolves it:

Read that carefully - it is a genuinely useful pattern MAX({FIXED [Region] : SUM([Sales])}) means "work out sales per region, then take the largest". Without the LOD there is no way to ask for the maximum of a group total, because MAX([Sales]) would give the largest single order instead.

Comparing each region to the best

North leads, so its gap is zero and every other region shows how far behind it sits.

The three LOD keywords

KeywordWhat it does
FIXEDIgnores the view completely, uses only its own dimensions
INCLUDEThe view’s dimensions plus the ones you name
EXCLUDEThe view’s dimensions minus the ones you name
Learn FIXED first FIXED covers the large majority of real cases and is the one interviews ask about. This playground implements FIXED only, and says so plainly if you try the other two - INCLUDE and EXCLUDE depend on the shelf layout of a real worksheet, which a web page has no way to represent honestly.

Try these yourself

  1. Write a percent-of-total calculation broken down by Category.
  2. Find the sales of the largest single Category using an LOD.
  3. Work out each region gap to the best-performing region.
  4. Explain why {FIXED : SUM([Sales])} returns the same number on every row.
  5. Explain the difference between MAX([Sales]) and MAX({FIXED [Region] : SUM([Sales])}).