Forum Discussion
Expression.Error: Evaluation resulted in a stack overflow and cannot continue.
- Anonymous2 years ago
Hi BarryFletcher ,
The reason for this problem is generally because, you are using recursion in your query (i.e. a function that calls itself appears).
When you had a small amount of data before, you were able to use recursion to calculate Power Query, so you were able to run it before. However, as the amount of data you are updating increases, the number of queries Power Query needs to process will increase exponentially until it reaches its processing limit, and then the error will occur.
The general solution is to Group by the data first, and then recurse on the data in each Group, so that the amount of data that needs to be processed for each recursion will be much smaller. Or you can go back to the data source and implement recursion in the data source, because the processing power of the data source will be much stronger than Power Query.
Also I found this blog that might be helpful:
Understanding the "Evaluation resulted in a stack overflow" error in Power Query in Excel and Power BI (crossjoin.co.uk)
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi all,
This is my file - I don't see any issues as outlined in the replies above - would appraciate if someone could take a look and help me out please?
https://drive.google.com/file/d/1LMuJGNIVpaD1e07MHXe77MpdAMWlETit/view?usp=drive_link
Much appreciated,
Barry