Understanding Filter Context and Row Context
DAX calculations depend not only on formulas but also on the context in which those formulas are evaluated.
Two fundamental concepts are row context and filter context.
What Is Row Context?
Row context refers to the current row being evaluated.
Calculated columns naturally operate with row context.
For example:
SalesAmount = Sales[Quantity] * Sales[UnitPrice]
For each row, DAX multiplies the Quantity and UnitPrice values from that row.
If one row contains Quantity = 3 and UnitPrice = 2,000, the calculated SalesAmount is 6,000.
What Is Filter Context?
Filter context is the set of filters affecting a calculation.
These filters may come from slicers, visual axes, report filters, page filters, or functions such as CALCULATE.
Consider this measure:
Total Sales = SUM(Sales[SalesAmount])
When used in a card without restrictive filters, it generally displays total sales across the available data.
When used in a chart with Product Category on the axis, Power BI evaluates the measure separately for each category's filter context.
This is why the same measure can produce different values across report visuals.
How CALCULATE Changes Filter Context
Consider the following measure:
Furniture Sales =
CALCULATE(
[Total Sales],
Products[Category] = "Furniture"
)
This expression applies a filter for Furniture while evaluating Total Sales.
For example, if the model contains the following sales:
Category | Sales |
| Electronics | 150000 |
| Furniture | 80000 |
| Clothing | 40000 |
The Furniture Sales measure returns 80,000 when evaluated over the complete dataset.
When other filters are present, the final result depends on how those filters interact with the filter specified in CALCULATE.
Why Context Matters
A DAX formula can be syntactically correct but still produce an unexpected result if its context is misunderstood.
When troubleshooting a calculation, ask:
- Is the formula intended to calculate a value for each row or aggregate multiple rows?
- Which slicers and filters affect the calculation?
- Are relationships allowing filters to reach the correct tables?
- Is a measure being evaluated at the intended level of detail?
Understanding context is essential before moving on to advanced DAX calculations.
Power BI Tutorial
Vishalini A








