Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Scenario:
R code is using setwd() function and is used in a Power BI report. Code currently runs fine in Power BI Desktop.
How does setting the working folder using setwd() work in Power BI Service, given that it's a managed Azure environment with (presumably) no direct access to the file system? Is this function supported at all? If so, how to use it properly?
P.S. The only official documentation around this seems to be at https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-r-scripts, which says: "When setting the working directory within the R script, you must define a full path to the working directory, rather than a relative path." However, that does not address the question.
What exactly does "According to the current information, this is impossible to achieve" mean?
What's "impossible to achieve"? Where is "current information" documented on docs.microsoft.com (or other authoritative Microsoft source)? Is the function itself completely unsupported within PBI Service? Or something else?
This function is used in R for a range of scenarios, including referencing files from a particular folder. So a whole range of scenarios rely on it and we need clarity on what PBI Service supports and does not support.
We are very experienced PBI Service users and have already consulted every bit of official product documentation. So please route this to the PG if a clear answer is unavailable through existing documentation.
Hi @vitaly ,
Hello, what kind of business needs do you need this function to achieve? According to the current information, this is impossible to achieve. So if you can provide detailed information on demand, I will try my best to answer it for you.
Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!