Forum Discussion
Power BI R query incredibly slow, when it should not be, any tips?
Hi, Saarek
I am not familiar with R. Here are some considerations and limitations when using R in Power BI Desktop you may refer.
To run the script in Power BI Desktop, make sure the script runs successfully in a new and unmodified workspace. This prerequisite means that all packages and dependencies must be explicitly loaded and run. You can use source() to run dependent scripts.
When you prepare and run an R script in Power BI Desktop, there are a few limitations:
- Because only data frames are imported, remember to represent the data you want to import to Power BI in a data frame.
- Columns typed as Complex and Vector aren't imported, and they're replaced with error values in the created table.
- Values that are
N/Aare translated toNULLvalues in Power BI Desktop. - If an R script runs longer than 30 minutes, it times out.
- Interactive calls in the R script, such as waiting for user input, halts the script’s execution.
- When setting the working directory within the R script, you must define a full path to the working directory, rather than a relative path.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Allan,
Appolgies for my delayed response. I've spoken with colleagues who have run into the same issue. For basic R Code Power BI does fine, but when trying to generate the dataset through R in Power BI it just runs at a snails pace.
I now run my R Code in Rstuido, output to csv file.
Originally I'd hoped that others could just hit refresh in Power BI and job done, but it's not to be.