sum vs sumx in power bi dax
what is difference between Sum and Sumx in Power BI
SUM() vs SUMX(): What is the difference between the two DAX functions?
SUM and Aggregator Functions: A single column is combined into one value via aggregator functions. After all context filters have been applied, SUM collects a single column and creates a single summing of the column. SUMX is an Iterator Function: Row-by-row iteration and evaluation are completed by iterator functions
SUM should be used whenever it is just a simple calculation across a single column and row-wise execution is not required. Hence, if your data is structured in a way that it contains only a single column of values, then you can use SUM to add up the values. The DAX SUM function operates over a single column and hence there is no need for an iterator in a case where you are simply trying to calculate the sum of a column of data.
SUMX is an iterator function and takes a different approach.
Unlike SUM, SUMX is capable of performing row-by-row calculations and iterates through every row of a specified table to complete the calculation.
SUMX then adds all the row-wise results of the iterations of the given expression.