Forum Discussion

SuraMan's avatar
SuraMan
Advocate II
6 years ago
Solved

Evaluation context inside FILTER

Hello,   I have a question about how evaluation takes place in the code snippet below. This filter() returns all the dates in 'Date'[Date] which are equal or less than the highest date in the curre...
  • Zubair_Muhammad's avatar
    6 years ago

    SuraMan 

     

    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