Forum Discussion
zenton
5 years agoHelper II
Measure is slow when using variables
I have been trying to learn more about Optimising Dax using a data sample from sqlbi (DAX Optimizations Examples with Alberto Ferrari) Orders Table has 1.6 million rows of data. I have two identical...
Anonymous
5 years agoNot applicable
To be able to answer the question one has to see the execution plans for both queries. There is no other way.
However, some things to observe:
1. The two measures (they are not queries!) are not logically equivalent.
2. The second one removes all filters from 'Date' BEFORE calculating the number of rows, so the logical expressions in filter can be totally ignored (in the presence of the assumed relationship). This is not the case in the first query when you first calculate the bounds and then use the bounds in the expression. These bounds stay put despite the ALL directive.