Skip to content

RemoveFilters

ContextCalculate modifier

RemoveFilters([dimOrColumn, …])

A modifier for Calculate. Removes the named columns or whole tables (RemoveFilters(Product, Customer)) from the user-filter set and from the grouping keys of the measure’s evaluation — which is exactly what makes a %-of-total denominator a total across the removed dimensions. RemoveFilters() with no arguments removes all user filters and grouping — the grand total.

It can never touch row-level security: RLS is applied beneath the measure layer and isn’t in the removable filter set, by construction.

  • % of total — the denominator that ignores the chart’s grouping.
  • vs-everyone benchmarks: each region’s bar next to the all-regions figure.
  • Grand-total KPI cards that must ignore slicers (RemoveFilters() bare).
PctOfTotalRevenue := Divide(
[Revenue],
Calculate([Revenue], RemoveFilters(Product, Customer))
)

The denominator computes in a sibling CTE grouped by whatever grouping remains after the removals — here, nothing:

// On a bar chart grouped by product
PctOfTotal := Divide([Revenue], Calculate([Revenue], RemoveFilters(Product)))

Each product row divides by the same total — exactly what a %-of-total column needs. Dashboard filters on other dimensions still apply inside the sibling.

  • Only meaningful inside Calculate(…) — used elsewhere it fails with SQX008.
  • Inside a Fixed body, RemoveFilters lifts user filters and outer grouping but cannot collapse the Fixed grain itself.