Module 03 · Calculations

Basic LOD expressions (FIXED)

Lock a calculation at the Region level so ordinary filters don’t change it.

Step by step8 minLesson 12 of 21 Free

A LOD (Level of Detail) expression tells Tableau to calculate at the level you choose instead of following the chart. FIXED means "lock it at this level": {FIXED [Region] : SUM([Revenue])} returns total Revenue per Region, whatever the chart shows and whatever ordinary filters are on. It’s handy for comparing a part with its whole, for example Online sales against the total of all channels in the same region.

Illustration of a text table per Region with a normal Revenue column and a FIXED column, the formula {FIXED [Region] : SUM([Revenue])} in the calculation editor, and a Channel filter on the Filters shelf (with its filter card on the right) set to Online: the Revenue column switches to Online numbers while the FIXED column keeps the full totals. Zoom
The Online filter changes the Revenue column, but the FIXED column stays the same.

Click a number on the picture or in this list to highlight that area.

Step by step

  1. Step 1: Open a new sheet, then create a new calculated field (Analysis → Create Calculated Field...), name it Region Total, type this formula (number 1), then click OK:

    Tableau
    {FIXED [Region] : SUM([Revenue])}

    Tip: Read it as "for each Region, add up Revenue". The curly braces are required; left of the colon is the level, right of it is what gets calculated.

    Watch out: In Module 2 you renamed the tidy group to Region (paperclip icon) and the original column to Region (raw), so [Region] here is already the tidy version with 5 cities. If you skipped that renaming, use [Region (group)] in the formula and Region (group) in the table; otherwise "Bandung " (with the space) can show up as an extra row.

  2. Step 2: Build a number table: hold Ctrl (Mac: Cmd) while clicking Region, Revenue and Region Total in the Data pane, then click Show Me on the right of the toolbar → text tables (the top-left box). Both number columns still match, e.g. Jakarta 753,408,000, because there is no filter yet.

  3. Step 3: Drag Channel to the Filters shelf (number 4), make sure only Online is ticked (click None first if needed), then OK. The Revenue column changes right away (number 2; Jakarta 324,829,000), but Region Total stays at 753,408,000 (number 3). Want the Channel checklist on the right of the view, as in the picture? Right-click the Channel pill → Show Filter.

    Tip: FIXED is calculated before ordinary filters, but after data source filters (the Null filter from Module 2 still applies) and context filters. Want the Channel filter to affect FIXED too? Right-click the Channel pill on Filters → Add to Context: the pill turns grey, moves to the top, and Region Total switches to the Online numbers as well.