Forum Discussion
Calculated column, measures and evaluation context
- 2 years ago
hi, Anonymous
in check_2 you gave only row context(because of calculated column ) you miss filter contextso when you wrap your code in calculate () it give filter context beacuse calculate() is filter modifier.
context transition happen only and only when both 1.row context and 2.filter context present in code.that's why in Check_2 you get 165 becuase of missing of filter context
when you wrap your code in CALCULATE() it give row context.
and it use expanded table that's why it evaluate even direct relationship is not presentin Check_1 you use measure
and in measure Calculate() present Internally that's why don't need to use Calculate().
Thanks for your reply. Maybe I need to elaborate more. My issues are:
1. Since there is no direct relationship between Sales and Purchase tables, how is Purchase table being filtered when Check_1 is being evaluated?
2. Just because Check_1 is made equal to a measure and Check_2 is essentially the same as Check_1 but in an expanded form, why are the values different?
hi, Anonymous
in check_2 you gave only row context(because of calculated column ) you miss filter context
so when you wrap your code in calculate () it give filter context beacuse calculate() is filter modifier.
context transition happen only and only when both 1.row context and 2.filter context present in code.
that's why in Check_2 you get 165 becuase of missing of filter context
when you wrap your code in CALCULATE() it give row context.
and it use expanded table that's why it evaluate even direct relationship is not present
in Check_1 you use measure
and in measure Calculate() present Internally that's why don't need to use Calculate().
- Anonymous2 years agoNot applicable
Great. This is what I was looking for. Just one doubt remaining. When context transition happens in Check_1, how can the filters propagate upwards from the 'many' side (i.e. Sales table) of a 'one to many' relationship and that too towards a table with which there is no direct relationship (i.e. towards Purchase table)?