DAX Filter Modifier Functions
potphodepraful
PowerBI consultant ·
They all modify CALCULATE's filter context — just differently
Every one of these functions exists to be used inside CALCULATE, and every one of them changes which filters apply to the calculation. The differences between them are exactly where most DAX mistakes involving "why is my total wrong" live.
ALL — clears filters entirely
ALL(Table) or ALL(Table[Column]) removes every filter on the table or column, regardless of what's selected in the report. It's how you build a "% of total" measure — the numerator respects the current filter, the denominator ignores it:
% of Total Sales =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], ALL ( Sales ) )
)
ALLEXCEPT — clears filters, but keeps some
ALLEXCEPT(Table, Table[ColumnToKeep]) is ALL's opposite instinct: remove every filter on the table except the ones on the columns you list. It's the right tool when you want a total that ignores most slicers but should still respect one specific one — a "total per region regardless of product" measure, for example.
ALLSELECTED — respects the report, ignores the visual
ALLSELECTED is the one people reach for and misunderstand most. It removes filters coming from inside the current visual's own context — the row/column being evaluated — while still respecting filters applied elsewhere on the page, like slicers. It's what makes a "% of total within what's currently filtered" measure work inside a table visual, where a plain ALL would ignore the page's slicers too and give a % of the entire unfiltered dataset instead.
KEEPFILTERS — adds instead of replacing
By default, a filter argument passed to CALCULATE replaces any existing filter on that column rather than combining with it. KEEPFILTERS changes that behavior to intersect instead of replace. Without it, CALCULATE(SUM(Sales[Amount]), Sales[Year] = 2026) overrides whatever year filter is already active and forces 2026 no matter what. With KEEPFILTERS wrapped around the filter argument, it only shows a result where both the existing filter and 2026 are true — which returns blank if the existing filter was already 2025.
REMOVEFILTERS — the modern, explicit version of ALL
REMOVEFILTERS(Table) does what ALL does when used as a filter modifier — clears filters — but says so directly, which matters because ALL is overloaded: it's also a table function used outside CALCULATE for iteration. Using REMOVEFILTERS when you specifically mean "clear this filter" makes the intent unambiguous to the next person reading the measure, yourself included six months later.
The mistake that connects all of this
Almost every "my total looks wrong in this one visual" bug traces back to reaching for ALL when ALLSELECTED was correct, or forgetting that a filter argument replaces rather than intersects and needing KEEPFILTERS. When a percentage-of-total measure behaves correctly on the report page but wrong inside a table with its own filters, that's almost always the ALL/ALLSELECTED distinction.