Function table / Level of detail / FIXED

Why your FIXED LOD ignores the filter

the #1 LOD question, settled with one line of SQL

A FIXED expression is calculated before ordinary dimension filters, so it still sees every row. Add the filter to context and it runs first. In SQL, the whole difference is where one WHERE line sits.

Category = Furniture is a

Calculated field: Share of region

SUM([Sales]) /
MIN({FIXED [Region] :
     SUM([Sales])})

Orders

RegionCategorySales
EastFurniture120
EastTechnology300
EastOffice80
WestFurniture200
WestTechnology150
WestOffice50
SouthFurniture90
SouthTechnology210

The same view as SQL

Result

RegionSalesTotalShare

flip it: the WHERE climbs into the totals

What happens

Tableau applies filters in a fixed order. Context filters run first, then FIXED expressions are computed, then dimension filters remove rows from the view. So the FIXED total per region is built from every category unless the Category filter runs before it.

For a share of total, that's what you want: Furniture is 24% of East. When the total should shrink with the filter, it isn't.

The same thing in Power BI

A DAX measure gets the dimension-filter behaviour by clearing every filter on the table except Region:

Share of region :=
DIVIDE (
    SUM ( Orders[Sales] ),
    CALCULATE ( SUM ( Orders[Sales] ),
                ALLEXCEPT ( Orders, Orders[Region] ) )
)

For the context-filter behaviour, keep Category too: ALLEXCEPT ( Orders, Orders[Region], Orders[Category] ).

Traps

  • SUM around a FIXED double-counts. The FIXED value repeats on every row of its region, so aggregate it with MIN, MAX or AVG.
  • Data source and extract filters always run first. They shrink the FIXED total whether or not you use context.
  • INCLUDE and EXCLUDE are different. They're computed after dimension filters, so they already respect Category.