Today I want to share a scenario where a running total calculation in the query editor saved a model that run out of memory when done with DAX:
Problem
The model couldn’t be refreshed and returned out of memory error with a calculated column in the fact table of over 20 Mio rows (from a csv-file). A running total should be calculated for each “JourneyID”, of which there were over 1 Mio in the table itself. This rose memory consumption during refresh by over 300 % – until it finally errored out:
Besetzung =
CALCULATE (
SUM ( Fact[Entries] )
– SUM ( Fact[Exits] );
FILTER (
ALLEXCEPT ( Fact; Fact[JourneyID] );
Fact[StopId]
<= EARLIER ( Fact[StopId] )
)
)
