Use ALL to clear filters from a table or column, ALLSELECTED to calculate against the broader user selection while removing the current query’s row or column filters, and ALLEXCEPT to clear every filter from one base table except filters on named columns.
They can produce the same number in a simple card and different numbers in a matrix. Always test the measure under slicers, detail rows, subtotals, and the grand total.
The short comparison
| Function | What it changes | Common use |
|---|---|---|
ALL ( Table ) |
Clears filters from the specified table | Grand total across that table |
ALL ( Table[Column] ) |
Clears filters from specified columns | Ignore color but keep category |
ALLSELECTED ( Table[Column] ) |
Removes row/column filters inside the query while keeping broader selection context | Percent of visible total |
ALLEXCEPT ( Table, Table[KeepColumn] ) |
Clears filters from a base table except named columns | Keep year while removing other Date filters |
Microsoft’s filter-function reference describes these as context-manipulation functions. The difficulty is not their syntax; it is identifying which filters came from which layer of the query.
Base model and measure
Assume a star schema:
Product (1) → Sales (*)
Date (1) → Sales (*)
And:
Total Sales =
SUM ( Sales[Sales Amount] )
Put Product[Category] on matrix rows and use a slicer on Product[Brand].
That gives the measure at least two Product filters:
- the current category row; and
- the selected brand.
The functions differ in which of those filters they remove.
ALL: clear a deliberate scope
ALL returns all rows or values from its base-table or base-column argument, ignoring filters on that scope. It is frequently used as a filter modifier inside CALCULATE.
Clear the whole Product table
Sales All Products =
CALCULATE (
[Total Sales],
ALL ( Product )
)
This removes category, brand, color, product name, and other filters on Product. Date, customer, and unrelated table filters can remain.
On each category row, the measure may repeat the same all-product value because the category filter has been removed.
Clear one column
Sales All Colors =
CALCULATE (
[Total Sales],
ALL ( Product[Color] )
)
This ignores color while keeping filters on category, brand, and other Product columns.
If the requirement is simply to clear filters, REMOVEFILTERS often expresses the intent more directly:
Sales All Colors =
CALCULATE (
[Total Sales],
REMOVEFILTERS ( Product[Color] )
)
The important choice is the argument scope, not whether you prefer the word ALL or REMOVEFILTERS.
ALLSELECTED: calculate a visual total
Microsoft defines ALLSELECTED as removing row and column filters in the current query while retaining explicit filters and context other than those row and column filters. This makes it useful for visual totals.
Consider:
Percent of Visible Categories =
DIVIDE (
[Total Sales],
CALCULATE (
[Total Sales],
ALLSELECTED ( Product[Category] )
)
)
On a category row:
- the numerator uses the current category and selected brand;
ALLSELECTED ( Product[Category] )removes the current category-row restriction;- the brand slicer remains; and
- the denominator becomes sales across the categories visible in the broader selection.
If the report user selects three brands, the denominator should normally reflect those selected brands rather than every brand in the model.
Why ALLSELECTED surprises people
ALLSELECTED depends on query shape. A card, matrix row, subtotal, tooltip, and nested iterator can expose different row/column context.
Do not define it as “ALL but keeps slicers” and stop there. That shortcut is useful at first, but the precise rule is about filters inside and outside the current query.
Test:
- no slicer selection;
- one brand selected;
- multiple brands selected;
- one category row;
- a category subtotal; and
- the grand total.
Write down the expected denominator for each case before trusting the percentage.
ALLEXCEPT: preserve named columns
ALLEXCEPT removes all context filters from one base table except filters applied to the columns you list.
Sales Keeping Year =
CALCULATE (
[Total Sales],
ALLEXCEPT ( 'Date', 'Date'[Year] )
)
If the current cell is March 2026, this measure removes month, day, and other Date-table filters while keeping 2026. It returns the year value under the remaining model filters.
Another example:
Sales Keeping Category =
CALCULATE (
[Total Sales],
ALLEXCEPT ( Product, Product[Category] )
)
On product rows, this clears product name, SKU, color, and brand filters from Product while keeping category. Products in the same category can therefore repeat the same category total.
ALLEXCEPT requires a base-table reference first and base-column references after it. It is not a general “keep any arbitrary expression” function.
The same report, three denominators
Suppose the matrix shows category rows, and a brand slicer selects Brand A.
Percent of All Products =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], ALL ( Product ) )
)
The denominator ignores category and Brand A because both filter Product.
Percent of Selected Products =
DIVIDE (
[Total Sales],
CALCULATE (
[Total Sales],
ALLSELECTED ( Product[Category] )
)
)
The denominator removes the current category row but normally keeps Brand A from the broader selection.
Percent Within Category =
DIVIDE (
[Total Sales],
CALCULATE (
[Total Sales],
ALLEXCEPT ( Product, Product[Category] )
)
)
The denominator keeps category but removes other Product filters, including brand. Whether that is useful depends on the business definition.
These formulas are all valid DAX. Only one may answer the intended question.
How to choose the function
Ask one sentence:
Which filters should the denominator ignore, and which must remain?
Then make the scope explicit.
Use:
REMOVEFILTERS ( Product[Color] )when one named filter must go;ALL ( Product )when all Product filters must go;ALLSELECTED ( Product[Category] )when the current category row should go but the user’s broader visible selection should remain; andALLEXCEPT ( 'Date', 'Date'[Year] )when every Date-table filter except year should go.
Avoid choosing by trial and error until the number “looks right.” A plausible percentage can still use the wrong denominator.
Debugging checklist
When the result is wrong:
- Put every relevant slicer and axis field in a small test visual.
- Add
[Total Sales]. - Add the denominator as its own measure.
- Remove one filter modifier.
- Test a detail row and total.
- Count visible keys with
COUNTROWS ( VALUES ( Dimension[Key] ) ). - Confirm the result under multi-select and clear-filter states.
If a measure repeats on every row, follow the same-value diagnostic. If the total changes unexpectedly, review why DAX totals recalculate.
Frequently asked questions
Is REMOVEFILTERS better than ALL?
When the goal is only to clear filters inside CALCULATE, REMOVEFILTERS is often clearer to read. ALL also has table-returning behavior in applicable expressions. Choose the form that states the intent and keep the argument scope narrow.
Does ALL remove every filter in the report?
ALL ( Product ) clears filters from Product, not automatically from Date, Customer, or every other table. ALL ( Product[Color] ) is narrower still.
Does ALLSELECTED always keep slicers?
It commonly preserves slicer filters because they are outside the current matrix row or column, but its exact result depends on the query context. Test the actual visual rather than relying on the slogan.
Can I practice these functions without building a new model?
Use the DAX playground or the CALCULATE practice problems. Predict the denominator first, then inspect the visible keys.