Problems exporting Power BI with R Script

1.8k Views Asked by At

DataSource.Error: ADO.NET: A problem occurred while processing your R script.

Here are the technical details: Information about a data source is required.

Details:

DataSourceKind = R

DataSourcePath = R

Message = A problem occurred while processing your R script.

Here are the technical details: Information about a data source is required.

ErrorCode = -2147467259

ExceptionType = Microsoft.PowerBI.Scripting.R.Exceptions.RUnexpectedException

This error comes up when I try to export my table using an R script

write.csv2(dataset, file = paste0("C:/Users/Acer/OneDrive/ALLPARTS/ALLPARTSNET_", format(Sys.time(), "%Y%m%d"), ".csv"), row.names=F)

Already tried:

  • reinstall R, R Studio and Power BI

Is there a solution?

LINK POWER BI FILE

https://1drv.ms/u/s!AnziDWh5m2I1gplLfe9FM2M0EFqDyw

2

There are 2 best solutions below

0
On BEST ANSWER
  1. Click on File > Options & settings > Options.
  2. Inside the Options window, you can change the Privacy in the Global or in the Current File section. Click on Privacy.
  3. Select “Ignore the Privacy Levels and potentially improve performance”.

RUN SCRIPT AGAIN!

0
On

Power BI often changes the data type upon importing data into Power BI, and this conflicts with how R interprets that data. In my specific case, the error I was getting was the exact same as yours

I fixed this by removing the Applied Step where Power BI changed the data type of all of my columns. It instantly fixed my issue.