Row Context & Filter Context: Evaluation Context in DAX
Table of Contents
Introduction
When working with DAX, there is a core concept of evaluation context. Understanding this concept is crucial because it determines how the formulas in DAX return results. In other words, the evaluation context is an “environment” in which the formula is calculated. There are two types of evaluation context, row context, and filter context, which are completely different from each other.
Let’s break them down.
Learn about DAX in our blog: DAX in Power BI: As a formula language
What is the Evaluation Context in DAX
In layman’s terms, an evaluation context defines what data a DAX formula ‘sees’ or uses when it calculates a value. There are two types of evaluation context in DAX:
- Row Context
- Filter Context
Learn more about the evaluation context in our blog: The Rules of Evaluation
Row Context
When you write an expression in a calculated column, Power BI evaluates the expression for each row of the table and creates a row context for every row. In a similar manner, when you use an iterator like FILTER(), SUMX(), AVERAGEX(), ADDCOLUMNS(), or any one of the DAX functions that iterates over a table or a table expression, it creates a row context.
Learn more about basic iterators in our blog: Basic Iterators in DAX: AVERAGEX(), MINX() & MAXX()
A row context is created when any DAX expression is evaluated for each row. Row context can be created by:
Row context using Calculated Column:
When you create a calculated column, Power BI evaluates the expression for each row to generate the values in the new column. This creates a row context. Therefore, any function used for creating a calculated column in Power BI creates a row context.
Row context using Calculated Measure:
Measures may or may not create a row context. If the measure is created using an iterator function, then the expression is evaluated for each row, and therefore, a row context is created. Whereas, if the measures use regular functions, then no row context is created.
Filter Context
Filter context is evaluated based on the filtering applied to the data model in DAX. The Initial/Incoming filter context comes from:
- Slicers
- Data Fields of a visual (e.g. Rows and Columns in Matrix)
- Page or Report Filters
- From other visuals
Filter context can be modified or replaced by using the CALCULATE() function. Filters otherwise automatically follow relationships from 1 to many sides. Filters naturally flow from the 1 to many side to the many side in a relationship, so that totals and calculations stay accurate and consistent across the model. That’s also why excessive cross-filtering or bi-directional relationships are usually avoided, since they can create confusion, ambiguity, and unexpected results in reports.
Filter Context vs Row Context
There are always two contexts in DAX, and these are known as the pillars of DAX. Let’s look at some basic differences between these two:
| Filter Context | Row Context |
Context Creation | Provided by the coordinates of the visual | Exists in Calculated Column or iterative DAX functions |
Role of CALCULATE() | CALCULATE() function can be used to alter a filter context. | CALCULATE() can convert a row context to a filter context. |
Relationships | Automatically follow the relationships from the 1 to many side. | Does not follow relationships or create a filter context. |
Conclusion
In DAX, to create dynamic and precise calculations, it is crucial to comprehend row context and filter context. While filter context chooses which subset of data is considered based on filters from visuals, slicers, or DAX functions like CALCULATE(), row context enables formulas to evaluate one row at a time.
Writing effective DAX formulas, creating intelligent Power BI reports, and making sure your measurements consistently yield the desired outcomes all depend on your ability to master these two evaluation contexts.
FAQs
In row context, a DAX formula is evaluated one row at a time, as in calculated columns or when using iterator functions like SUMX() or FILTER(). Formulas can use other columns in the same row without aggregation.
The filter context determines which rows of data are taken into account when evaluating a DAX formula. Visuals, slicers, page filters, report filters, and the CALCULATE() function can all be used to alter it. For measures in Power BI, the filter context is crucial.
Formulas can generate unexpected results if the row and filter context is not understood. You can create precise, dynamic DAX formulas that adjust to your reports by understanding how each context functions.
Further Learning and Resources
To learn more about Power BI, check out our courses here:
- Power BI Essentials
- Power BI Report Design
- Power BI Advanced
- Power BI DAX Essentials
- Power BI Service Course
- ChatGPT Essentials
Want to learn how Microsoft 365 Copilot transforms everyday work with AI? Check out our Course:
- Microsoft 365 Copilot Training Courses
- Want to learn more about Power BI and how to make reports more efficiently?
Power BI training in Australia: We offer comprehensive training sessions across various cities, including :
Power BI Crash Course eBook: Download our detailed guide to take your Power BI expertise to the next level, covering topics from basics to advanced with practical examples and step-by-step instructions. (Limited time offer)
Download the Beginner’s Guide to Power BI
Ready to enhance your Power BI skills? Sign up for our training courses and explore our wide range of resources designed to elevate your data analytics capabilities.
Contact Us: Make an enquiry about our Power BI courses and find the proper training for you.







