Forum Discussion

vgeldbr's avatar
vgeldbr
Helper IV
4 years ago
Solved

Using CALCULATE or not

I'm looking for some experienced guidnce on whether best practice is to use CALCULATE or not. See these two measures which both produce the correct result. Which is considered the right or best way t...
  • Whitewater100's avatar
    Whitewater100
    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..