Tableau error Level of detail

The calculation contains errors

Level of detail expressions cannot contain table calculations or the ATTR function

Inside {FIXED ...} Tableau needs a real aggregation such as SUM, MIN or MAX. ATTR and table calculations like RUNNING_SUM or INDEX are not allowed there.

Updated · Checked on the xmetric engine

Which formula raises it, and what fixes it?

Raises the error
{FIXED [Region] : ATTR([Sales])}
Tableau: Level of detail expressions cannot contain table calculations or the ATTR function

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. SUM answers "total Sales per Region", which is what this example asks. MIN or MAX would answer a different question and can hide several distinct values.

The 3 example rows
RegionSales
East20
West10
West5

What else raises this message?

  1. Raises it

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

    Fixed

    RUNNING_SUM(MIN({FIXED [Region] : SUM([Sales])}))

    Compute the per-region total in the LOD, then run the table calculation over the view. MIN returns the FIXED total once per region instead of adding it up for every row.

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

  2. Raises it

    {INCLUDE [Region] : ATTR([Region])}

    Fixed

    {INCLUDE [Region] : MIN([Region])}

    MIN or MAX return an actual value of the field; ATTR is only allowed in the view, not inside a level of detail.

    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?

Why does ATTR work in my view but not inside FIXED?

ATTR is a view-level check that returns * when a mark holds several values. A level of detail expression must produce real values, so it needs a true aggregate such as MIN, MAX, SUM or COUNTD.

How do I get the dimension value inside an LOD?

Use MIN([Field]) or MAX([Field]). When the field has one value per level, both return it.

Where is this message documented?