There are some proposals for you troubleshooting the issue.
1. If you are using 32 bit Power BI Desktop, uninstall it and use 64 bit Power BI Desktop to connect to your data source instead.
2. Increase the amount of memory available on your machine, and increase the size of “Maximum allowed” as shown below in Power BI Desktop.
3. Optimize your data model following the guide in this blog, the blog also applies to Power BI Desktop though it is about PowerPivot.