Forum Discussion
hendustu
Advocate I
11 years agoCan PowerQuery write data back out?
So I know that PowerQuery is great for consuming and transforming data, but are there any export options? If not, what's the least klugey way to get data out of a BI model and into SQL tables, or a C...
- 11 years ago
Consider making a feature request on the "Give Feedback" site.
jbulk
Advocate I
9 years agoYou can also add an R script step in the query editor that writes the data set to a csv.
Here is the code.
Transform and load your data with Power BI, M and R | Anthony Bulk | Pulse | LinkedIn
# 'dataset' holds the input data for this script
# set the working directory to the location in which you want the transformed CSV saved
setwd("C:/temp")
# write out the transformed data set
write.table(dataset, file="transformed_data.csv", sep = ",", row.names = FALSE)
# put the data set into a data frame so that you can continue to work with it.
# I did an extra transformation and then built a report off of it
df1 <- data.frame(dataset)Gozde
Helper I
9 years agoHi Antony,
Thanks for R script, it helped me a lot.
Is there a way to add current date to these script?
So, when I refresh, it will automatically save the date with the day in the title like "transformed_data-06/09/2017.csv".
Regards,
Gozde
- ImkeF9 years ago
Community Champion
I would simply add it to the dataset itself: Add a custom column with: DateTime.LocalNow()