Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have a R visual which creates a directory in your local using dir.create(C:/foldername) and it is working fine in Power Bi desktop but same when deployed in Power Bi service, it is throwing me an error like C:/foldername does not exist. That means it is not creating directory.
Could you please help me fix the solution for this.
Thanks,
Shubham
Solved! Go to Solution.
Hi @Anonymous ,
Sorry for the delay. I may misunderstand your scenario before.
By my research for your sceanrio, I'm afraid that we cannot show your desired output in Power BI Service based on R scripts security.
Best Regards,
Cherry
Hi @Anonymous ,
By my tests with the latest version of Power BI Desktop, it seems that everything works as expected.
Here is my setting.
If you still need help, please share a dummy pbix file which can reproduce the issue, so that we can help further investigate on it? You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.)
You also could have a test with my test pbix file.
Best Regards,
Cherry
Thanks @v-piga-msft for your reply.
My code works in a following : - first it will create a directory if it does not exists. then if it exisits then Message will be printed as "Folder exists" else Message will be printed as "Folder does not exists". Ideally it should never go into else part because i am creating my direcory in the first line.
It does work fine in Power BI desktop as you can see the result in the above image itself.
When i publish to Power BI services, it does not creates the directory and falls in to the else part. Please find below image :
Please find the below full R code and can you please replicate the same. Just copy-paste it into R visual script and pass 1 dummy column. It will be very helpful for me.
# Sheet name ExportSheet = "Sheet 1" # Appends data to existing file or overwrites existing fle AppendToPreviousFile = FALSE # Includes header. Better to set to false if AppendToPreviousFile is TRUE WithHeader = TRUE ### Export functions ################################################################################## Message <- function(Text,Comment) { par(mar=c(1,1,1,1)) NoPlot = c(0) barplot(NoPlot) plot(1:1, 1:1, main = "", sub = "", fg="white") text(1, 1.2, Text, cex = 2, fg="white") text(1, 0.8, Comment, cex = 1.5, fg="white") return() } ExportFile = "C:/RData/AssetData.xlsx" dir.create("C:/RData/") #This creates a folder if not exists ExportFolder = dirname(ExportFile) if (dir.exists(ExportFolder)){ #If folder exists then execute below code Message("Folder exist",ExportFolder) } else { #else Message("Folder does not exist",ExportFolder) }
@v-piga-msft Could you please replicate the same and see if it is possible to solve or not. I really need help on this.
Thanks in advance.
Hi @Anonymous ,
Sorry for the delay. I may misunderstand your scenario before.
By my research for your sceanrio, I'm afraid that we cannot show your desired output in Power BI Service based on R scripts security.
Best Regards,
Cherry
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
109 | |
100 | |
95 | |
38 | |
37 |
User | Count |
---|---|
152 | |
125 | |
75 | |
74 | |
63 |