Forum Discussion
Evaluation context inside FILTER
- 6 years ago
I believe the rule to remember is that
Inside a MEASURE1) Expressions like SUM,MAX will always respond to available FILTER CONTEXT
Since FILTER is only an iterator and introduces ROW CONTEXT only, MAX( ‘Date’[Date] ) responds to the FILTER context of the VISUAL (Matrix, Table, chart etc) which you are using.
If you use CALCULATE(MAX( ‘Date’[Date] )), we should get different results because in that case it will transform the ROW CONTEXT introduced by FILTER function into FILTER CONTEXT.
2) Naked column references (TableName[ColumnName]) inside an INTERATOR like FILTER,SUMX,MAXX will refer to ROW CONTEXT of that ITERATOR
I believe the rule to remember is that
Inside a MEASURE
1) Expressions like SUM,MAX will always respond to available FILTER CONTEXT
Since FILTER is only an iterator and introduces ROW CONTEXT only, MAX( ‘Date’[Date] ) responds to the FILTER context of the VISUAL (Matrix, Table, chart etc) which you are using.
If you use CALCULATE(MAX( ‘Date’[Date] )), we should get different results because in that case it will transform the ROW CONTEXT introduced by FILTER function into FILTER CONTEXT.
2) Naked column references (TableName[ColumnName]) inside an INTERATOR like FILTER,SUMX,MAXX will refer to ROW CONTEXT of that ITERATOR
Thanks Zubair_Muhammad for the explanation