This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi ,
When i am trying to export powerb dataset into a csv file using R script(shown below)
filename="D:\\BIR\\bitest3.csv"
#dataset <- data.frame(Id, Name)
# dataset <- unique(dataset)
write.csv(dataset,filename)
I am able to generate file when i run power bi desktop but when i try to run the same file using power bi services
i am getting permission denied error, we have tried give all the permission to this folder, file etc.
We have checked gateway dataconnection setting as well, everything is working fine.
PFB error message from power bi services.
Error 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 'D:\BIR\bitest3.csv': Permission denied
Please try again later or contact support. If you contact support, please provide these details.
Activity IDd1ed46a2-b6d3-401e-8cf8-b28d8dd9f593
Request ID9bf14fcd-ec9c-500a-f9f7-e85facebf04c
Correlation ID32cea294-6fc1-2b12-9147-e4ebac8b1d0f
TimeSun Jul 14 2019 15:48:26 GMT+0530 (India Standard Time)
Version13.0.9933.305
Cluster URIhttps://wabi-india-central-a-primary-redirect.analysis.windows.net
Thanks
Pankaj
Solved! Go to Solution.
Hi @pankaj1408 ,
For security/permission reasons, you can't execute r script(power bi service side) to loading external data source or do export/import operations on specific path.
Creating R visuals in the Power BI service
Regards,
Xiaoxin Sheng
here is my r script,
# 'dataset' holds the input data for this script
output <- as.data.frame(dataset)
currentDate <- Sys.Date()
csvFileName <- paste("C:/Users/
WIP1_", currentDate, ".csv", sep="")
write.csv(dataset,
file = csvFileName, sep=",",
row.names=F)
i have the same problem even in the desktop version
Hi @pankaj1408 ,
For security/permission reasons, you can't execute r script(power bi service side) to loading external data source or do export/import operations on specific path.
Creating R visuals in the Power BI service
Regards,
Xiaoxin Sheng
@Xiaoxin,
In my case I have a dataset created from dataflow and R script to export it to CSV, upload it to SharePoint. This works fine on Power Bi desktop. Are you saying this will not work on Power BI services due to security reasons ?
Regards,
Jyoti Pawar
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |
| User | Count |
|---|---|
| 48 | |
| 34 | |
| 27 | |
| 21 | |
| 20 |