KEEPFILTERS with an IN list: a filter that respects the slicer

Show promo-color sales only where the visual already shows those colors, by wrapping an IN list in KEEPFILTERS.

You will learn to

  • Intersect an IN list with the visual’s own filter
  • Predict the result in rows outside the list
  • Recognize FILTER(VALUES(…)) as another way to keep filters

How it works

An `IN` list is a column filter like any other, so it **replaces** the row’s filter on that column. In a matrix by Color, `Product[Color] IN {"Red", "Blue"}` shows red-plus-blue sales in every row, even the Black row.

Wrap the list in `KEEPFILTERS( )` and CALCULATE keeps the row’s colors too: only colors in **both** lists survive. The Blue row keeps Blue, and the Black row keeps nothing, so it goes blank. With a slicer on Red and Black, you would see red sales only.

`FILTER(VALUES(Product[Color]), …)` does the same job: `VALUES` starts from the colors already visible, so the test can only narrow them down.

Practice it hands-on with a real data model and a live report that updates as you type.

Visible Gear Sales = CALCULATE([Total Sales], KEEPFILTERS(Product[Category] IN {"Accessories", "Clothing"}))