Ravindra BagaleCourses & study guides Track your progress

Guides

DAX Row Context vs Filter Context in Power BI

Filter context is the set of filters from slicers, visuals and the Filters pane that decide which rows a measure sees; row context is the “current row” while a calculated column or an iterator (like SUMX) evaluates — two contexts, two jobs.

Chala mitrano! If DAX ever felt like magic, it was usually these two words. Why? Measures live in filter context; columns and iterators live in row context. How? We feel both with FreshBasket (fictional) Amount, then name them aloud. Longer page — worth it.

Quick answer

Vertical contrast:

  1. Put [Total Sales] on a Card → change a slicer → that is filter context.
  2. Write a calculated column using Sales[Amount] → that is row context.
  3. SUMX ( Sales, Sales[Qty] * Sales[UnitPrice] ) creates row context inside the loop.
  4. Measures do not start with row context.
  5. Columns do not recalculate like measures when slicers move.
  6. Next skill: CALCULATE can transition row context into filter context.
Filter context → which rows a measure sees
Row context    → which row an expression is on

Why two contexts, rows in / number out

Same three rows:

Order ID City Amount
A Mumbai 100
B Mumbai 40
C Nashik 80

Filter context demo

  1. Card with [Total Sales] = SUM ( Sales[Amount] ).
  2. No slicer → rows in: all three. Number out: 220.
  3. City slicer = Mumbai → rows in: A and B. Number out: 140.
  4. That “which rows are visible” world is filter context.

Row context demo

  1. New column: TaxCol = Sales[Amount] * 0.18.
  2. On row A, Amount is 100, so TaxCol is 18.
  3. On row B, Amount is 40, so TaxCol is 7.2.
  4. The formula knows this row’s Amount without SUM. That is row context.

Why both exist:

  1. Managers ask for totals that react to slicers → measures + filter context.
  2. Each slip needs its own tax stamp → columns + row context.
  3. Mixing the two without language is why students say “DAX is random.”
Row vs filter context Two evaluation contexts Row contextcurrent row Filter contextvisible rows contexts

Row context = current row (columns / iterators). Filter context = which rows a measure sees from slicers and visuals.

What do I need before this guide?

Before and after (look at the tables first)

Before filter context Open filter context; total 190.

Before

After Mumbai filter context Mumbai filter context; total 150.

After

Filter context = which rows a measure sees (Mumbai → 150). Row context = “this row” inside iterators like SUMX. Different tools, different jobs.

Part A — Feel filter context

  1. Card with [Total Sales].
  2. City slicer → Mumbai.
  3. Number drops to 140.
  4. Matrix with City on rows — each cell is a different filter context.

Part B — Feel row context

  1. New column: TaxCol = Sales[Amount] * 0.18.
  2. Browse Data view — each row has its own tax.
  3. Slicers do not rewrite that stamped column the way a measure recalculates.
Two contexts usage Column vs measure contexts Column → row context Measure → filter context split

Calculated column walks row context; a card measure walks filter context. Mixing them up is the classic DAX confusion.

Part C — Iterators bring row context into measures

Line Total =
SUMX (
    Sales,
    Sales[Qty] * Sales[UnitPrice]
)

Vertical reading:

  1. SUMX walks Sales rows (row context each time).
  2. Multiplies Qty × UnitPrice on that row.
  3. Adds the results — under the outer filter context of the visual.
  4. City = Mumbai still limits which rows enter the loop.
Context examples TaxCol vs Total Sales TaxCol = this row Amount [Total Sales]sum under slicers example

Tiny story: TaxCol uses this row’s Amount; [Total Sales] sums Amount only for rows still visible under slicers.

FreshBasket story (fictional)

  1. TaxCol stamps every order slip with 18% tax (row).
  2. [Total Sales] adds Amount only for slips still on the desk after the City slicer (filter).
  3. Phone-bill analogy: the line items on your bill are row context; “total due this month” after you filter one month is filter context.

Mistakes and calm fixes

Symptom Likely cause Fix
Column ignores slicer “logic” Expecting measure behaviour Use a measure for KPI totals
Measure cannot see “this row” No row context / no transition Iterator or CALCULATE transition (next guide)
SUMX equals weird number Wrong table / missing filters Check relationships; simplify
Vocabulary freeze in interview Never named the contexts Practise the two demos aloud

Ghabru naka 😅 — naming the context is half the battle.

Ravindra Bagale's Tip

Interview line: “Row context is the current row; filter context is the filters from the report.” Then show one column and one measure example. Students who only say “CALCULATE” without context words sound incomplete. Got it?

Practice task

  1. Build TaxCol and [Total Sales] on the same model.
  2. Demo filter context with a Mumbai slicer (expect 140 on sample data like above).
  3. Write four lines naming which context each object used.
  4. Skim the evaluation context course lesson.

Got it? Filter context = visible rows for measures. Row context = current row for columns/iterators. Next: context transition with CALCULATE. Let's continue.

Frequently asked questions

What is filter context?

The filters from slicers, axes, and the Filters pane that decide which rows a measure aggregates.

What is row context?

The “current row” while evaluating a calculated column or an iterator expression (SUMX, FILTER, etc.).

Does a measure have row context by default?

No. A measure starts with filter context. Row context appears when iterators (or context transition) create it.

Why is my column ignoring the slicer?

Calculated columns are stored values; slicers filter which rows appear, but the column formula did not “re-run under the slicer” like a measure.

Where do interviews go next?

Context transition with CALCULATE, then ALL / RELATED families.

Course lesson?

Evaluation context in the DAX chapter.