Context & Filtering
Understanding Row Context
The current row pointer inside calculated columns and iterators.
Syntax Definition:
Conceptual foundation
Overview
Row Context refers to the awareness of the current row being scanned. It exists automatically in calculated columns and is created by iterators like SUMX and FILTER.
Architectural Deep Dive
Crucially, Row Context DOES NOT filter the data model! A calculated column scanning row 5 cannot automatically see related sales or filter visuals. To turn a row context into a filter context, you must trigger Context Transition using CALCULATE.
Canonical Pattern Example:
// Row context exists here: Profit = Sales[Revenue] - Sales[Cost]
Common Anti-Patterns & Mistakes to Avoid
- •Assuming Row Context filters relationships—it does not! You must use RELATED or Context Transition.
- •Creating dozens of unnecessary calculated columns instead of measures.
Interactive Challenge
Put Understanding Row Context into practice
Solve "Calculate Total Margin with SUMX" in our interactive Monaco editor with live dataset verification.