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:
- Row-level calculations, then
PRE_FILTERcalculations on all the rows of the dataset. Filters onPRE_FILTERfields are applied here. - Analysis filters on ordinary fields, like a SQL
WHERE. PRE_AGGcalculations on the rows that are left. Filters onPRE_AGGfields are applied here, then top and bottom N filters.- Level-aware aggregates such as
sum({Sales}, [{Customer}]). - Visual aggregation, then filters on aggregated values, like a SQL
HAVING. - Table calculations with the default level, such as
runningSumorsumOver(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 |
PRE_FILTERwas computed on all seven orders, so Anna keeps her 500 from the South.PRE_AGGwas computed after the filter removed the South rows.- The default level sums the visual’s rows by customer, which here gives the same as
sum({Sales}). It starts to differ when the visual has more dimensions than the partition, for example Region and Customer with a partition on Region only.
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:
- A
PRE_FILTERvalue ignores every analysis filter, including the date filter that readers expect to apply. Use it only for values that should really not move. - The visual aggregation of a
PRE_*field should be Min, Max or Average, the AWS default being Min: the value repeats on every row of its partition, and Sum multiplies it.
Related guides
- How to calculate a total per customer regardless of the visual
- How to compute a value before filters are applied
- How to count customers whose total is above a threshold
Checked against the Amazon Quick Sight documentation (October 2026). The example results were recomputed in DuckDB.