Forum Discussion
analytics_uk
5 years agoHelper I
Memory error: Memory Allocation failure . Try simplifying or reducing the number of queries.
Hi, I get the above message when refreshing on Power BI Online. I have isolated the problem and know that it is literally related to the one calculated column below: _Next Order Date = CALCUL...
Anonymous
5 years agoNot applicable
Hi analytics_uk
First off, one should refrain from calculating columns via DAX (too many reasons to state). It should be done in the source or in Power Query, where such calculations truly belong and where they'll be fast. Second, one should never use CALCULATE in calculated columns on big fact tables. CALCULATE executes context transition and this is always very costly. If you pair it with the number of rows that this needs to be calculated for in a fact table... well, you get the gist. It'll almost always throw a memory-overflow error.
Here's a version that does not use CALCULATE, so there's a chance it'll work. But, as I said, you should ideally calculate this outside DAX for speed and memory efficiency reasons.
[_Next Order Date] =
var CurrentDate = Order_Header[Date]
var CurrentEmail = Order_Header[Customer_Email]
var Result =
MINX(
FILTER(
Order_Header,
Order_Header[Date] > CurrentDate
&&
Order_Header[Customer_Email] = CurrentEmail
),
Order_Header[Date]
)
return
Result