Forum Discussion
lbendlin
6 years agoSuper User
CALCULATE() or iterator function
There seems to be some personal preference involved with the use of CALCULATE(MAX()) versus MAXX() etc. I am still trying to understand the arguments pro and contra (as well as the context transitio...
AlexisOlson
6 years agoSuper User
As a general rule of thumb, it's usually preferred to not use iterator functions where they aren't needed. For many expressions, they will be internally optimized to the same final query but it's much easier to inadvertently write poorly performing code with iterators (e.g. putting IF functions inside of one where using a filter would be more efficient).
I'd recommend reading up on SUM vs SUMX articles for more detail and context.
https://exceleratorbi.com.au/use-sum-vs-sumx/
https://radacad.com/sum-vs-sumx-what-is-the-difference-of-the-two-dax-functions-in-power-bi