Foundations First

What Is Row Context? How Is It Different From Filter Context?

Use the same sales table in two different ways. First, watch DAX focus on a single row. Then apply filters and see how the visible rows change for aggregation.

Mental Model

Row context = "Which single row am I currently evaluating?" Filter context = "Which rows are visible to my calculation right now?"

Row context points to one row. Filter context shrinks or expands the set of rows a measure can see.

Real-world analogy

The classroom

Row context is the teacher's roll call: one student at a time. Filter context is the classroom door: it decides who is in the room at all.

  1. A table is a class. Each student is one row.
  2. Row context = roll call. The teacher looks at one student at a time. Nobody leaves the room.
  3. Filter context = the door. β€œSection B only.” Everyone else steps out, so only 3 rows are visible.
  4. Together. Roll call now visits only the students still in the room.

Sales Table

Gold = row context, Green = filter context
Order Customer Region Category Amount

Difference in plain words

Foundation for context transition
Explain more

Row Context

One row at a time

Created by calculated columns and iterator functions like SUMX, AVERAGEX, FILTER, and ADDCOLUMNS. It tells DAX which row it is currently standing on.

Filter Context

A set of visible rows

Created by slicers, filters, relationships, and CALCULATE(). It decides which rows a measure can see when computing an aggregation like SUM.

Example 1: Row context expression
Line Value = Sales[Quantity] * Sales[Unit Price]
This works because DAX evaluates the current row.

Example 2: Filter context measure
Total Sales = SUM(Sales[Amount])
This measure changes only when the visible set of rows changes.