Forum Discussion
Saving Data Weekly for a Power Bi Report
I've set up a "snapshot" style data dump where I have a report that when it refreshes, writes a CSV file to a SharePoint location, with a year-week number in the filename. The code for this report (there are no visuals needed) uses some R script to write to a local machine, so you need a Personal Gateway running on it.
Then you could have a separate report that reads the CSV files in the SharePoint location and loads the correct one(s) according to your parameter.
If this sounds like a solution to your issue, once you have installed R Open, the R code you will need is:
R.Execute("# 'dataset' holds the input data for this script#(lf)write.csv(dataset, file = "C:/LocalFilePathToSharePointSync/Snapshot_Week-" & Number.ToText(CurrentWeek) & ".csv"")",[dataset=#"Previous Step"])