Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vicente-iii
Helper I
Helper I

Automate the Export of Dataset from Power BI Service to OneDrive

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

1 REPLY 1

@vicente-iii Unfortunetly, I am not aware of any write back mechanisms that work in an automated fashion from Power BI. This is likely why the error states read only. Additionally, I don't know of any place where you can extract or see the refresh schedule, which is why you are likely going down this path. 


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.