When working with Power BI, especially when writing DAX (Data Analysis Expressions) formulas, two of the most fundamental concepts to understand are Row Context and Filter Context. These contexts determine how DAX evaluates expressions, and misunderstanding them can lead to incorrect calculations.
📌 What is Row Context?
Row Context exists when a DAX formula is evaluated for a single row of a table. It’s the environment in which the formula knows the values of all the columns for that specific row.
✅ When Does Row Context Happen?
Row context automatically exists in:
- Calculated columns
- Iterative functions like
SUMX(),FILTER(),FOR EACH ROWscenarios
🧠 Example:
Imagine a Sales table with these columns:
QuantityUnitPrice
Now, you create a calculated column:
Total = Sales[Quantity] * Sales[UnitPrice]
Here, DAX evaluates this expression for each row in the Sales table. For each row, it picks the Quantity and UnitPrice from that row — that’s Row Context in action.
📌 What is Filter Context?
Filter Context refers to the filters applied to a calculation, such as:
- Visual filters (e.g., a slicer or a visual level filter)
- Page or report level filters
- Filters added manually using DAX functions like
CALCULATE(),FILTER(), etc.
✅ When Does Filter Context Happen?
Filter context exists:
- In measures
- In visuals with filters applied
- Inside
CALCULATE()function
🧠 Example:
Let’s say we have this measure:
Total Sales = SUM(Sales[Total])
If this measure is placed in a visual with a filter on Year = 2024, the SUM will only consider rows where Year = 2024. This is Filter Context — it defines which rows are included in the calculation.
🔁 How Row and Filter Context Work Together
A powerful part of DAX is how Row Context and Filter Context interact. They can be used together, but they are not the same thing.
🚨 Key Note:
- Row context doesn’t automatically generate filter context.
- But
CALCULATE()can convert row context into filter context when needed.
📦 Example: Using CALCULATE
Let’s say you have a Customers table, and you want to count all sales by a specific customer. This measure uses CALCULATE() to override the filter context:
Sales for John =
CALCULATE(
[Total Sales],
Customers[CustomerName] = "John"
)
Here, CALCULATE adds a new filter context (CustomerName = John) and then evaluates [Total Sales] under that context.
✅ Summary
| Feature | Row Context | Filter Context |
|---|---|---|
| Created in | Calculated columns, iterators | Measures, visuals, CALCULATE() |
| Purpose | Evaluates DAX expressions per row | Filters down the rows being considered |
| Automatic? | Yes (in row-based calculations) | Yes (in visuals), or manually via DAX |
| Converted to other? | No, unless via CALCULATE() | Not converted to row context |
🧠 Tips to Remember
- Think of Row Context as “for this row, what is the value?”
- Think of Filter Context as “only include rows where…”
- Use
CALCULATE()when you need to change or add filters dynamically.
Understanding these contexts will unlock your ability to write powerful, accurate DAX formulas in Power BI. Once mastered, you’ll be able to solve complex reporting challenges with confidence.


Leave a comment