Code action DR002
(Readability) Use aggregator instead of iterator
Description
Use an aggregator function instead of an iterator function when possible, to simplify the code.
Example
Change:
SUMX(Sales, Sales[Line Amount])
To:
SUM(Sales[Line Amount])
Why is Tabular Editor suggesting this?
When you need to aggregate the values of a single column only, aggregator functions (SUM
, MIN
, MAX
, etc.) use simpler, more concise syntax, than their equivalent iterator functions (SUMX
, MINX
, MAXX
, etc.) and should be preferred to make the code more readable.