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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi everyone, I have an issue in adding the below to my query steps.
write.csv(dataset, file = "C:/Users/XXXX/Desktop/dataset.csv")
whenever I run it, it displays another empty table with column names Name and Value.
Here's the query if it will help 🙂 let Source = Excel.Workbook(File.Contents("\\USMFXXXXXL1C\DataAll\WeekID.xlsx"), null, true), WeekIndex_Table = Source{[Item="WeekIndex",Kind="Table"]}[Data], #"Changed Type" = Table.TransformColumnTypes(WeekIndex_Table,{{"Week Ending DATE", type date}, {"Week Number", Int64.Type}, {"Hours", Int64.Type}}), #"Run R script" = R.Execute("# 'dataset' holds the input data for this script#(lf)require('gdata')#(lf)write.csv(dataset, file = ""C:/Users/XXXXX/Desktop/dataset.csv"")",[dataset=#"Changed Type"]) in #"Run R script"
Hi , @Anonymous
Could you please tell me whether your problem has been solved?
The R script you wrote is just used to export data to the desktop as a csv.
After running this R script, it will display another empty table with name and value columns in the edit query, which is the normal result.
You only need to check whether it generates a csv file which contains the result you want on the desktop .
If the exported date format is incorrect, please convert the date format to text in query editor.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi , @Anonymous
I suggest you to try below solution to use function "write.table" instead of "write.csv":
If help ,you can also refer to this post.
Best regards,
Eason