Cheat Sheets/Power BI/KEEPFILTERS
DAX function

KEEPFILTERS — DAX function reference

Add a filter without overriding.

Syntax

dax
CALCULATE(<expression>, KEEPFILTERS(<filter>))

Examples

dax
CALCULATE([Sales], KEEPFILTERS(Sales[Region] = "West"))
→ A number

Without KEEPFILTERS, every row of a category-sliced visual would show the Bikes total because the boolean filter overrides the existing context.

dax
CALCULATE(SUM(Sales[Amount]), KEEPFILTERS(Product[Category] = "Bikes"))
→ Only returns a value for Bikes; other categories return blank
dax
CALCULATE(SUM(Sales[Amount]), KEEPFILTERS(Sales[Amount] > 500))
→ Combines with any existing amount filter instead of overriding it

Common mistakes & gotchas

Related DAX functions

From Filter context

← Back to the Power BI (DAX) cheat sheet