RemoveFilters
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.
When to use it
Section titled “When to use it”- % 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).
Example
Section titled “Example”PctOfTotalRevenue := Divide( [Revenue], Calculate([Revenue], RemoveFilters(Product, Customer)))Under the hood
Section titled “Under the hood”The denominator computes in a sibling CTE grouped by whatever grouping remains after the removals — here, nothing:
// On a bar chart grouped by productPctOfTotal := Divide([Revenue], Calculate([Revenue], RemoveFilters(Product)))WITH "__sqx_0" AS ( -- Revenue with Product lifted from filters AND grouping ⇒ the total SELECT SUM("Sales"."amount") AS "val" FROM "sales" AS "Sales")SELECT "Product"."name", CASE WHEN MAX("__sqx_0"."val") = 0 OR MAX("__sqx_0"."val") IS NULL THEN NULL ELSE CAST(SUM("Sales"."amount") AS FLOAT) / MAX("__sqx_0"."val") END AS "PctOfTotal"FROM "sales" AS "Sales"JOIN "products" AS "Product" ON …CROSS JOIN "__sqx_0"GROUP BY "Product"."name"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.
Good to know
Section titled “Good to know”- Only meaningful inside
Calculate(…)— used elsewhere it fails with SQX008. - Inside a
Fixedbody,RemoveFilterslifts user filters and outer grouping but cannot collapse theFixedgrain itself.