As we have seen already in Chapter 1, What is DAX?, the filter context can be defined as a set of filters that are applied over the tables in a data model before a DAX expression is evaluated. The context in which a DAX expression is evaluated directly affects the result that is returned. This means that the same DAX expression can return different results, depending upon the context.
Filter context exists in the following:
- All visuals in Power BI
- A pivot table in Excel
Filter context can be applied through use of the following:
- Rows and columns in a visual or a pivot table
- Slicers
- Filters
- Interaction with visuals (acting as filters)
- The CALCULATE function
A DAX expression is only evaluated when all the filters coming from the context just listed have been applied to the tables in the data model. In the case of a matrix visual in Power BI or...