{ FIXED : SUM([Revenue]) } has no dimensions, so it adds every row of the data source and repeats that total on each mark. Tableau also accepts the short form { SUM([Revenue]) }. In SQL it is an empty window over the grouped rows, sum(sum(Revenue)) OVER (), or a scalar subquery (SELECT sum(Revenue) FROM input).
Updated · Checked on the xmetric engine
What is the syntax?
{ FIXED : SUM([Revenue]) }
aggregate
an aggregate expression, such as SUM([Revenue]).
Returns a number per row: the total over the whole data source.
What does it return, and what is the SQL?
Each example runs on the same 12 sample rows twice: the Tableau formula on the xmetric engine, and the SQL in DuckDB.
What is the grand total on each region row?
Tableau
{ FIXED : SUM([Revenue]) }
SQL (DuckDB)
SELECT Region, sum(sum(Revenue)) OVER () AS result
FROM input
GROUPBY Region
ORDERBY Region
All three regions show 1,650.
Region
Result
North
1,650
South
1,650
West
1,650
✓ The Tableau formula and the SQL return the same 3 rows.
Where does a straight translation go wrong?
Common mistake
Why does a window on each line multiply the total?
sum(Revenue) OVER () on the raw rows puts 1,650 on every line; summing it per region counts it five times for North. Tableau repeats it once per mark.
Tableau
SUM({ FIXED : SUM([Revenue]) })
Tempting SQL
SELECT Region, sum(t) AS result
FROM (
SELECT Region, sum(Revenue) OVER () AS t
FROM input
)
GROUPBY Region
ORDERBY Region
SQL that matches
SELECT Region, sum(sum(Revenue)) OVER () AS result
FROM input
GROUPBY Region
ORDERBY Region
Region
Tableau
Tempting SQL
SQL that matches
North
1,650
8,250
1,650
South
1,650
8,250
1,650
West
1,650
3,300
1,650
✓ The SQL that matches returns the Tableau result on every row; the marked cells are where the tempting SQL differs.
Common mistake
Why does GROUP BY Region give region totals?
A FIXED with no dimensions ignores the view. The grouped sum is the region total (North 650); the FIXED value is 1,650 everywhere.
Tableau
{ FIXED : SUM([Revenue]) }
Tempting SQL
SELECT Region, sum(Revenue) AS result
FROM input
GROUPBY Region
ORDERBY Region
SQL that matches
SELECT Region, sum(sum(Revenue)) OVER () AS result
FROM input
GROUPBY Region
ORDERBY Region
Region
Tableau
Tempting SQL
SQL that matches
North
1,650
650
1,650
South
1,650
550
1,650
West
1,650
450
1,650
✓ The SQL that matches returns the Tableau result on every row; the marked cells are where the tempting SQL differs.
How do I write it in Snowflake or BigQuery?
The first example, written for each warehouse from its documentation. These are not run here; DuckDB is.
Snowflake
SELECT Region, SUM(SUM(Revenue)) OVER () AS result
FROM input
GROUPBY Region
ORDERBY Region
Ordinary dimension filters on the Filters shelf do not: FIXED is computed before them. Add a filter to context (or filter the data source) to make it count only the rows that survive. In SQL, a context filter is a WHERE inside the subquery or window; an ordinary filter is a WHERE that does not reach it.
Why wrap the FIXED total in SUM or MIN?
Tableau's help says a level of detail expression on a shelf is always wrapped in an aggregate. The grand total repeats on every mark, so SUM, MIN and MAX of it agree; writing one in the formula makes that explicit. See Region share of fixed total.
Is { SUM([Revenue]) } the same?
Yes. Tableau's help calls it a table-scoped expression, equivalent to FIXED with no dimensions.