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:
- Put
[Total Sales]on a Card → change a slicer → that is filter context. - Write a calculated column using
Sales[Amount]→ that is row context. SUMX ( Sales, Sales[Qty] * Sales[UnitPrice] )creates row context inside the loop.- Measures do not start with row context.
- Columns do not recalculate like measures when slicers move.
- 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
- Card with
[Total Sales] = SUM ( Sales[Amount] ). - No slicer → rows in: all three. Number out: 220.
- City slicer = Mumbai → rows in: A and B. Number out: 140.
- That “which rows are visible” world is filter context.
Row context demo
- New column:
TaxCol = Sales[Amount] * 0.18. - On row A, Amount is 100, so TaxCol is 18.
- On row B, Amount is 40, so TaxCol is 7.2.
- The formula knows this row’s Amount without SUM. That is row context.
Why both exist:
- Managers ask for totals that react to slicers → measures + filter context.
- Each slip needs its own tax stamp → columns + row context.
- Mixing the two without language is why students say “DAX is random.”
Row context = current row (columns / iterators). Filter context = which rows a measure sees from slicers and visuals.
मित्रांनो — Row context = current row (columns / iterators). Filter context = which rows a measure sees from slicers and visuals.
मित्रों — Row context = current row (columns / iterators). Filter context = which rows a measure sees from slicers and visuals.
What do I need before this guide?
- A simple
[Total Sales]measure (DAX beginner). - Optional: SUM vs SUMX.
- Course: Evaluation context.
Before and after (look at the tables first)
Before
आधी (Before)
पहले (Before)
After
नंतर (After)
बाद में (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
- Card with
[Total Sales]. - City slicer → Mumbai.
- Number drops to 140.
- Matrix with City on rows — each cell is a different filter context.
Part B — Feel row context
- New column:
TaxCol = Sales[Amount] * 0.18. - Browse Data view — each row has its own tax.
- Slicers do not rewrite that stamped column the way a measure recalculates.
Calculated column walks row context; a card measure walks filter context. Mixing them up is the classic DAX confusion.
मित्रांनो — Calculated column walks row context; a card measure walks filter context. Mixing them up is the classic DAX confusion.
मित्रों — 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:
- SUMX walks Sales rows (row context each time).
- Multiplies Qty × UnitPrice on that row.
- Adds the results — under the outer filter context of the visual.
- City = Mumbai still limits which rows enter the loop.
Tiny story: TaxCol uses this row’s Amount; [Total Sales] sums Amount only for rows still visible under slicers.
मित्रांनो — Tiny story: TaxCol uses this row’s Amount; [Total Sales] sums Amount only for rows still visible under slicers.
मित्रों — Tiny story: TaxCol uses this row’s Amount; [Total Sales] sums Amount only for rows still visible under slicers.
FreshBasket story (fictional)
- TaxCol stamps every order slip with 18% tax (row).
[Total Sales]adds Amount only for slips still on the desk after the City slicer (filter).- 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?
Ravindra Bagale's Tip – मराठी
Interview line: “Row context म्हणजे current row; filter context म्हणजे report मधले filters.” मग एक column आणि एक measure उदाहरण दाखवा. जे context शब्दांशिवाय फक्त “CALCULATE” म्हणतात ते incomplete वाटतात. समजलं का?
Ravindra Bagale's Tip – हिंदी
Interview line: “Row context यानी current row; filter context यानी report के filters.” फिर एक column और एक measure उदाहरण दिखाओ. जो context शब्दों के बिना सिर्फ “CALCULATE” कहते हैं वे incomplete लगते हैं. समझ में आया?
Practice task
- Build TaxCol and [Total Sales] on the same model.
- Demo filter context with a Mumbai slicer (expect 140 on sample data like above).
- Write four lines naming which context each object used.
- 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.
समजलं का? Filter context = visible rows for measures. Row context = current row for columns/iterators. Next: context transition with CALCULATE. आता पुढे जाऊया.
समझ में आया? Filter context = visible rows for measures. Row context = current row for columns/iterators. Next: context transition with CALCULATE. आगे बढ़ते हैं.
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.