Function table / Level of detail / Fixed total with ordinary filter

Fixed total with ordinary filter, from Tableau to SQL

An ordinary dimension filter does not change the fixed total. Below, 8 sample rows go through the calculation and through the SQL, and both return the same numbers.

Calculated field

{ FIXED : SUM([Revenue]) }

Sample data

RegionTeamCustomerRevenueSeatsDate
NorthCedarAster12042026-01-05
NorthCedarAster8022026-02-05
NorthCedarBirch30062026-01-12
NorthPineClover9032026-02-14
SouthElmDahlia20052026-01-08
SouthElmDahlia10022026-02-08
SouthAshFern7532026-01-20
SouthAshFern2512026-02-20

The same calculation as SQL

SELECT MAX((SELECT SUM(Revenue) FROM input)) AS result FROM input WHERE Region='North'

Runs the example above.

Result

result
990

Same rows from the calculation and from the SQL in DuckDB.

Where a naive translation goes wrong

  • Applying the ordinary Region filter before the fixed SUM incorrectly reduces the fixed denominator.

    Naive SQL

    SELECT SUM(Revenue) AS result FROM input WHERE Region='North'
    result
    590

    Matches the calculation

    SELECT MAX((SELECT SUM(Revenue) FROM input)) AS result FROM input WHERE Region='North'
    result
    990

Signature

{ FIXED : SUM([Revenue]) }