sumOver, countOver, rank and the other window functions accept a third argument, the calculation level. It decides when QuickSight computes them, and therefore which filters they see. PRE_FILTER runs before the analysis filters, PRE_AGG after them, and the default, POST_AGG_FILTER, after the visual has aggregated the data.

Copy and paste

sumOver({Sales}, [{Customer}], PRE_FILTER)       /* ignores the analysis filters */
sumOver({Sales}, [{Customer}], PRE_AGG)          /* respects them */
sumOver(sum({Sales}), [{Customer}])              /* default: over the visual's rows */

The first two take an unaggregated field; the default level takes an aggregated one.

The order of evaluation

AWS documents the sequence in which an analysis is evaluated. Simplified:

  1. Row-level calculations, then PRE_FILTER calculations on all the rows of the dataset. Filters on PRE_FILTER fields are applied here.
  2. Analysis filters on ordinary fields, like a SQL WHERE.
  3. PRE_AGG calculations on the rows that are left. Filters on PRE_AGG fields are applied here, then top and bottom N filters.
  4. Level-aware aggregates such as sum({Sales}, [{Customer}]).
  5. Visual aggregation, then filters on aggregated values, like a SQL HAVING.
  6. Table calculations with the default level, such as runningSum or sumOver(sum(...)), then totals and subtotals.

Dataset-level filters, calculated fields and row-level security happen before all of this, in the dataset. PRE_FILTER does not see rows that row-level security hides from the reader.

The same field at three levels

The seven orders of the conditional logic guides, with a sheet filter Region = North. The visual is a table by Customer:

Customer sum(Sales) PRE_FILTER PRE_AGG Default level
Anna 700 1,200 700 700
Bruno 350 350 350 350

Choosing a level

You want Level
A value that ignores what the reader filters: a fixed total, a lifetime value PRE_FILTER
A per-entity value that follows the filters: the customer total for the selected dates PRE_AGG
A value over what the visual shows: running totals, shares of the visible total default
To use the result as a dimension or a row filter PRE_FILTER or PRE_AGG

Two practical rules:

Related guides

Checked against the Amazon Quick Sight documentation (October 2026). The example results were recomputed in DuckDB.

References