CONTEXT — Context is the layer of filtering It is applied to calculations.
Two types of Context:
- Filter Context
- Row Context
FILTER CONTEXT
- The filter context is a set of column-based filters.
- It can be modified by functions like CALCULATE().
- Follows the one to many relationships automatically.
Example:
- Column = CALCULATE(SUM (‘Product’[DealerPrice]))
2. Column 2 = ‘Product’[DealerPrice] * ‘Product’[ListPrice]
ROW CONTEXT
- Row context is effective when you create calculated columns or execute code inside an iterator function.
- Exists in special DAX functions like SUMX and FILTER.
- Does not follow relationship.
- A row Context does not create a filter context.
Example:
- Column 5 = (‘Product’[DealerPrice] + ‘Product’[ListPrice])
2. Column 3 = SUM (Product[DealerPrice])
3. Column 4 = SUMX(‘Product’,’Product’[DealerPrice] * ‘Product’[ListPrice])
If you are newer to Power BI learning then following must-watch video: -