Tableau error Level of detail

The calculation contains errors

Result of a level of detail expression must be an aggregate

The part after the colon in an LOD expression must be aggregated. {FIXED [Region] : [Sales]} has a bare field, so Tableau does not know how to reduce many rows to one value per Region.

Updated · Checked on the xmetric engine

Which formula raises it, and what fixes it?

Raises the error
{FIXED [Region] : [Sales]}
Tableau: Result of a level of detail expression must be an aggregate

The xmetric engine rejects it too.

Fixed
{FIXED [Region] : SUM([Sales])}

Per Region, on the 3 example rows, it returns:

RegionResult
East20
West15

Why it works. A FIXED expression returns one value per group of the named dimensions. SUM gives the total per Region; use AVG or MIN only if that is the metric you want.

The 3 example rows
RegionSales
East20
West10
West5

What else raises this message?

  1. Raises it

    {INCLUDE [Region] : [Sales] * 2}

    Fixed

    {INCLUDE [Region] : SUM([Sales]) * 2}

    The expression after the colon is computed at the declared level, so it has to aggregate the rows in each group.

    Checked on the xmetric engine: the first fails, the fix runs.

  2. Raises it

    {EXCLUDE [Region] : [Sales]}

    Fixed

    {EXCLUDE [Region] : SUM([Sales])}

    EXCLUDE removes Region from the view's level; the rows that fall together still need a SUM.

    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?

Is { FIXED : MAX([Order Date]) } an aggregate?

Yes. With no dimensions it computes MAX over the whole table, which is a common way to find the latest date in the data.

Can the result of a FIXED expression be used as a row-level field?

Yes. A FIXED result is attached to every row of its group, so you can use it in row-level IFs, then aggregate the outer formula.

Where is this message documented?