Tableau error Aggregation
Cannot mix aggregate and non-aggregate arguments with this function.
Your formula puts a row-level field and an aggregate such as SUM in the same expression. One side reads a single row, the other a group total, so Tableau rejects it. Make both sides row-level or both aggregate.
Which formula raises it, and what fixes it?
[Sales] / SUM([Sales])The xmetric engine rejects it too.
SUM([Sales]) / MIN({FIXED : SUM([Sales])})Per Region, on the 3 example rows, it returns:
| Region | Result |
|---|---|
| East | 0.57 |
| West | 0.43 |
Why it works. Both sides are now aggregate: the region's total over the grand total. MIN returns the FIXED grand total once per mark; SUM would add it up for every row and shrink the share.
The 3 example rows
Region | Sales |
|---|---|
| East | 20 |
| West | 10 |
| West | 5 |
What else raises this message?
Raises it
[Sales] - AVG([Sales])Fixed
AVG([Sales]) - MIN({FIXED : AVG([Sales])})To compare a region's average with the overall average, aggregate both sides; MIN of a FIXED value returns it once, without adding it up per row.
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?
Should I wrap the field in ATTR to make the error go away?
Only when the field has a single value in every mark, like a dimension already on the view. ATTR returns * when a mark holds several values, so it silences the error without giving you the number you meant.
When is IF ATTR([Region]) = 'East' THEN SUM([Sales]) END the right fix?
When you want one answer per mark: the region's total if the mark is East. SUM(IF [Region] = 'East' THEN [Sales] END) answers a different question, the East rows' total inside any mark, and works at every level of detail.
Where is this message documented?
- Where the message is reported (help.salesforce.com) checked October 17, 2026