Hi all
I need to export a dataset as a csv or xlsx file to One Drive upon a scheduled refresh from Power BI Service. I have made an R code which allows me to do this on Power BI Desktop but I am having a lot of issues doing the same thing on Power BI Server.
This is the R code I have used:
require(gdata)
write.csv(trim(dataset), file = "filepath/dataset.csv", row.names = F)
plot(dataset)
This is the error message I am getting from Power BI Service:
In file(file, ifelse(append, "a", "w")) : cannot open the connection. In addition: Warning message: In file(file, ifelse(append, "a", "w")) : cannot open file "filepath/dataset.csv": Permission denied
I was thinking that I need to change the filepath to a path that can find One Drive online rather than on my local disk ie.
But it is still errors for both Power BI Desktop and Service with the following error message:
can only open URLs for readingError in file(file, ifelse(append, "a", "w")) : cannot open the connection Calls: write.table -> file Execution halted
Any ideas on how to solve this? Thank you