Forum Discussion
What's the difference between these 2 queries?
- 2 years ago
This is what happens under the hood for query 1,
For any CALCULATE() / CALCULATETABLE(), DAX engine evaluates all filter arguments ( 1.expanded table and 2.predicate in your case ) independently from each other before final evaluation.
More specifically,
1.expanded table
filters Ddim via [related C] and [related SC] (data lineage kept)
2.predicate
doesn't propagate the filtering to Ddim due to 1:* direction constraint by default.
An alternative to query 2 is
This is what happens under the hood for query 1,
For any CALCULATE() / CALCULATETABLE(), DAX engine evaluates all filter arguments ( 1.expanded table and 2.predicate in your case ) independently from each other before final evaluation.
More specifically,
1.expanded table
filters Ddim via [related C] and [related SC] (data lineage kept)
2.predicate
doesn't propagate the filtering to Ddim due to 1:* direction constraint by default.
An alternative to query 2 is
Many thanks!
Now I know what I misunderstood about the CALCULATE.
I mistakenly thought CALCULATE merges the filter arguments by intersection before applying to the data model as below:
The arguments are evaluated independently from each other in the CALCULATE, and they filter the corresponding columns separately before final evaluation.