# How do I preserve or replace report filters in a DAX measure?

Exam: DP-600 — Implementing Analytics Solutions Using Microsoft Fabric
Knowledge domain: Implement and manage semantic models (25–30%)
Updated: 2026-11-19T05:35:27.836407+00:00
HTML: https://learningpathx.com/faq/DP-600/dp600-dax-filter-preserve-replace.html

## Also asked as

- When should I use KEEPFILTERS or REMOVEFILTERS with CALCULATE?
- How can I change one DAX filter without removing unrelated report context?

Use CALCULATE to evaluate a measure in a modified filter context. A normal filter argument replaces existing filters on the same columns; KEEPFILTERS intersects the new condition with existing filters. REMOVEFILTERS clears the specific filters you name.

For example, assuming \[Revenue\] and Product\[Color\] exist:

```dax
Selected Red Revenue =
CALCULATE ( [Revenue], KEEPFILTERS ( Product[Color] = "Red" ) )
```

A selection that excludes red yields no qualifying red rows rather than being overwritten. For a share-of-all-colors denominator, use `CALCULATE ( [Revenue], REMOVEFILTERS ( Product[Color] ) )` so date and customer context can remain.

Prefer a Boolean column filter when it fully expresses the condition. FILTER is appropriate when you must evaluate a measure or a more complex row-dependent condition over a table; scope that table as narrowly as the rule permits. Boolean CALCULATE filters have restrictions, including not directly referencing measures or columns from multiple tables.

Test a matching selection, a conflicting selection, multiple selections, and totals. Removing all filters from a whole table can discard more context than intended, so verify exactly what the denominator or comparison must ignore.

[CALCULATE reference](https://learn.microsoft.com/en-us/dax/calculate-function-dax). [Filter-argument guidance](https://learn.microsoft.com/en-us/power-bi/guidance/dax-avoid-avoid-filter-as-filter-argument).

Source: [DP-600: Advanced DAX Patterns for Enterprise Semantic Models](https://learningpathx.com/news/dp-600-advanced-dax-patterns-for-enterprise-semantic-models.html)
