Tableau error Table calculation
All fields must be aggregate or constant when using table calculation functions or fields from multiple data sources.
A table calculation such as LOOKUP works on the marks in the view, not on rows. Every field it touches must be aggregated first, so a bare [Sales] inside LOOKUP fails.
Which formula raises it, and what fixes it?
LOOKUP([Sales],-1) + SUM([Sales])The xmetric engine rejects it too.
LOOKUP(SUM([Sales]),-1) + SUM([Sales])Per Region, on the 3 example rows, it returns:
| Region | Value | Result |
|---|---|---|
| East | 20 | null |
| West | 15 | 35 |
Why it works. SUM([Sales]) gives one value per mark, and LOOKUP can step from mark to mark. Here Region is the addressing dimension, ascending, in one partition; a different order changes the result.
The 3 example rows
Region | Sales |
|---|---|
| East | 20 |
| West | 10 |
| West | 5 |
What else raises this message?
Raises it
RUNNING_SUM([Sales])Fixed
RUNNING_SUM(SUM([Sales]))Table calculations work on the marks in the view, so their argument must be an aggregate.
Checked on the xmetric engine: the first fails, the fix runs.
Raises it
[Sales] - WINDOW_AVG(SUM([Sales]))Fixed
SUM([Sales]) - WINDOW_AVG(SUM([Sales]))Compare the mark's own sum with the window average; both sides now live at the mark level.
Checked on the xmetric engine: the first fails, the fix runs.
Does my formula have this problem?
Paste your formula and run it on the example rows. It uses the fields [Region], [Sales]; rename yours to match.
Runs in your browser on the xmetric engine. Nothing is uploaded.
Which functions does this involve?
What do people ask about this error?
What makes a calculation a table calculation?
Any of LOOKUP, RUNNING_, WINDOW_, INDEX, RANK, FIRST, LAST, SIZE, TOTAL and PREVIOUS_VALUE. Once one appears, everything else in the formula has to be an aggregate or a constant.
Can I use a table calculation inside a FIXED expression?
No. Level of detail expressions are computed before table calculations, so the order makes it impossible. Compute the LOD first and apply the table calculation on top.
Where is this message documented?
- Where the message is reported (help.salesforce.com) checked October 17, 2026