Forum Discussion
Using CALCULATE or not
- 4 years ago
Hi:
Nested Iterators can be tricky and that's another reason voting for option number 1. Here is an article on the topic. The iterators have to go thru your table row by row and SUMX and FILTER are iterators.
I hope this article will fill in any blanks. As a rule of thumb is if it is processed faster with less burden on the vertipaq, it is better. Saying too much more would be just guessing as the factors I mentioned earlier al come into play. Avoiding nested iterators, when possible, is better and will result in less double counting that comes with nested iterators if you are not careful.
Article:
https://www.sqlbi.com/tv/optimizing-nested-iterators-in-dax/
I hope this solves your question. Lot's of data out there on this but I have given you he highlights. Thanks..
Whitewater100 thanks for your thoughts on performance differences. I'd not considered that aspect and will look into it as you suggest. Other than performance differences, are there any other considerations as to which approach is considered the better practice?
Hi:
Nested Iterators can be tricky and that's another reason voting for option number 1. Here is an article on the topic. The iterators have to go thru your table row by row and SUMX and FILTER are iterators.
I hope this article will fill in any blanks. As a rule of thumb is if it is processed faster with less burden on the vertipaq, it is better. Saying too much more would be just guessing as the factors I mentioned earlier al come into play. Avoiding nested iterators, when possible, is better and will result in less double counting that comes with nested iterators if you are not careful.
Article:
https://www.sqlbi.com/tv/optimizing-nested-iterators-in-dax/
I hope this solves your question. Lot's of data out there on this but I have given you he highlights. Thanks..