Video | Tableau | Data visualisation | Analytics

The Fixed level of detail calculation Explained

All the theory is done, let's take on our first LOD and see how these concepts work.

Part ofTableau Level of detail functions
  • The viz level of detail is controlled by dimensions on rows, columns and the marks pane (colour, detail, label, path) — but the tooltip does not change it
  • FIXED LODs run before dimension filters in the order of operations, so they keep the context of a total even when you filter rows out of the view
  • FIXED is the only LOD that works independently of the visualisation, even when the dimension you fix on is already in the view
  • Use a FIXED calculation as the denominator to compute a percentage of total against a category that stays correct as the view changes
  • FIXED { MIN([Order Date]) } per customer gives a first-order date you can reuse for cohort analysis with no external ETL

Prerequisites and why they matter

This is one of the most requested topics on the channel, so I’m finally taking on level of detail calculations, starting with the FIXED LOD. Before you dive in, there are two concepts worth nailing down because we lean on them throughout.

The first is the order of operations. We use it to work out which level of detail calculation we should reach for and, crucially, when each step runs. The second is granularity — understanding what a single row actually represents in your data set. If either of those feels shaky, go and read up on them first, because everything here builds on that foundation.

Understanding the viz level of detail

Simple bar chart with Sales on rows and Sub-Category on columns in Tableau Superstore

Open a simple Superstore visualisation and the first thing to grasp is the viz level of detail: the level of detail you currently have in your view. Build a quick bar chart with Sales on rows and Sub-Category on columns, and you can see it in action.

Any dimension you place on rows or columns changes the level of detail. Drag Category onto columns and the chart splits further. The same applies to the marks pane — Colour, Detail, Label and Path all change the level of detail, even when the dimension isn’t visible in the chart itself. The one exception is the tooltip: drop a field there and the level of detail stays put (it shows a star, which relates to the ATTR function). So the rule is simple — rows, columns and most of the marks pane change what you see; everywhere else does not.

The percentage of total problem

Table calculation percentage of total jumping to 100% after filtering to Chairs only

Now for a real challenge. Put Category and Sub-Category on rows, Sales as text, and open the summary window so it acts as a calculator. We want the percentage of total within each category. A quick table calculation set to compute using the Pane gets us there — each category’s sub-categories add up to 100%.

The frustration comes when you filter. Keep only Chairs and that percentage jumps to 100%, because the dimension filter strips out the other rows before the table calculation runs. The order of operations is working against us: the filter happens before the aggregation, so we lose the context of the category total. This is exactly where LODs shine, because the FIXED calculation runs before dimension filters — it sits between context filters and dimension filters in the order of operations.

Writing your first fixed LOD

FIXED LOD calculation syntax in Tableau calculated field editor: { FIXED Category : SUM(Sales) }

Keep Chairs in the view and open a calculated field. FIXED uses a distinctive notation with curly brackets. You open the LOD with a brace, type FIXED, declare the dimension you want to target, then write your aggregation, and close it off.

The calculation here is { FIXED [Category] : SUM([Sales]) }. Walking through the parts: the curly brackets open and close the LOD; the green keyword tells Tableau which type you want (FIXED, INCLUDE or EXCLUDE); the dimension declaration sets the level of detail; and the aggregation is written just as you normally would. The key thing about FIXED is that it acts independently of the visualisation — even when Category is already in the view, the calculation behaves the same whether it’s there or not. Drag this into the view and you’ll see it return the category total of 742,000 and, vitally, hold onto that number even when you filter down to Chairs.

Finishing the percentage of total

Percentage of total field showing 44.3% with Chairs filter applied, matching unfiltered result

With the total locked in, finish the calculation. Create a new field that divides the view-level SUM([Sales]) by the fixed category figure: viz sum of sales divided by the category sum of sales. One side listens to the visualisation, the other is pinned to Category, so the percentage will always be computed against the category no matter how the view changes.

Drop it in and it reads zero at first — that’s just rounding, so set the default number format to a percentage with one decimal place. Now it shows 44.3%. The moment of truth: remove the Chairs filter and the original table calculation also showed 44.3% there, but with the filter applied it had wrongly jumped to 100%. The FIXED LOD gives the correct answer either way because it moves the calculation up the order of operations and keeps the right value in context.

Cohort analysis with fixed LOD

Bar chart with Sales by Order Date coloured by year of first order date, showing cohort breakdown

The second use case shows FIXED prescribing a level of detail. A quick aside on the data model — each table has its own granularity. Superstore sales sit at the individual product level within an order, not the order level, and People and Returns differ again. Worth bearing in mind when you relate tables.

What I want is the first order date for each customer. The long way would be a separate ETL job to build a customer-to-first-order table and join it back. The quick way is { FIXED [Customer Name] : MIN([Order Date]) }, which returns the first order date repeated across every row for that customer — no data prep needed. Then build a bar chart with Sales over the order date, with no Customer in the view, and put the year of that first-order field on Colour. In the first year of business every customer is naturally 100% new; in later years the split changes. Add a percentage of total computed table-down and label it, and you can confidently report that 77% of customers in 2018 were first-time customers — a textbook cohort analysis built almost instantly.

Resources and limitations

Tableau 'Top 15 LOD Expressions' documentation article listing common LOD use cases

These calculations get complex quickly, so it pays to know where to look. Tableau’s own level of detail documentation page is thorough and ideal if you like precision. From there, the “Top 15 LOD Expressions” article is the one I’d encourage everyone to read — it covers common questions like new customer acquisition, comparative analysis, percentage of total and proportional brushing. If you’ve ever tried something that felt simple but didn’t behave as expected, an LOD was probably the missing piece.

There are caveats too. The “how LOD expressions work” page details limitations to watch for — you tend to discover them when you hit them — and importantly lists which data sources support LODs. Most modern databases like Amazon Redshift and SQL Server are fine on recent versions, but cubes carry restrictions worth checking before you get stuck in. Next up I’ll cover INCLUDE and EXCLUDE, which are slightly easier mechanically but a bit more of a mental maze.