Forum Discussion
Slow cumulative running total
Anonymous wrote:
This is a basic cumulative running total I am using...SUM1 is a calculated column that is a sum of 4 columns...no issues
Actually this can sometimes cause issues as calculated columns like this can often produce resulting columns that have much higher cardinality than the source columns resulting in higher memory usage and lower performance.
The other issue could be the use of ALLSELECTED, this is a relatively expensive function and I don't think it's required for a typical running sum so try just swapping the ALLSELECTED for the ALL function. Or you could even try doing a SUMX and referencing the original 4 columns (if this is faster then you could remove your calculated column entirely)
Running Total = CALCULATE(
SUMX('Table_1', col1 + col2 + col3 + col4),
FILTER(
ALL('Table_1'[Date]),
ISONORAFTER('Table_1'[Date], MAX('Table_1'[Date]), DESC)
)
)
- Anonymous6 years agoNot applicable
Thank you for the suggestion, but neither solution helped improve the speed