Understanding Filter Context

The invisible set of active filters driving every Power BI cell.

Syntax
Conceptual foundation

Overview

Filter Context is the cumulative set of filters applied to the semantic model by slicers, visual axes, filters pane, and cross-highlighting.

In Power BI, a measure has no value in isolation. Its value is entirely determined by its Filter Context. When you look at a table visual with Country on rows and Year on columns, the cell at (Norway, 2025) has a Filter Context of Customers[Country]='Norway' AND Date[Year]=2025.

// Evaluates strictly inside active filter context:
Total Revenue = SUM(Sales[Revenue])

When to use Understanding Filter Context

  • Understanding why a measure returns a different number on each row, column and total of a visual.
  • Debugging totals that do not add up or slicers that seem to be ignored.
  • Designing measures that deliberately change which filters apply.

Worked examples

Seeing the filter context

Visible Products =
COUNTROWS ( VALUES ( 'Product'[Product] ) )

Put this measure next to others in a visual: it shows how many products are visible in each cell. On a product row it is 1; on the total it is all filtered products. That is the filter context at work.

Changing the filter context

Share of Category =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product'[Product] ) )
)

The denominator removes the product filter from each row, leaving the category filter (if Category is also on the visual), so each product is compared with its category.

Common mistakes

  • Confusing Filter Context with Row Context.
  • Not understanding that CALCULATE is the only mechanism to overwrite or remove Filter Context.

Performance notes

Filter context itself costs nothing — it is how the engine knows which data to scan. Narrow filters make queries cheaper. Measures become expensive when they repeatedly rebuild large filter contexts, for example by removing filters from a fact table inside an iterator.

Frequently asked questions

What creates filter context?
Rows and columns of a visual, slicers, page and report filters, filters propagated through relationships, and CALCULATE filter arguments.
What is the difference between filter context and row context?
Filter context decides which rows are visible to an aggregation. Row context is the current row inside an iterator or calculated column, and it does not filter anything by itself.
Why does my total not equal the sum of the rows?
The total is evaluated in its own filter context (all rows together), not by adding the visible cells. For non-additive measures such as ratios or distinct counts this is expected.

Related DAX concepts