Forum Discussion
feed visuals and tables based on different CSV files
- 3 years ago
OneDrive is basically SharePoint so that's a good start. Just bear in mind, for a more robust solution, having it on an actual SharePoint site would be better, e.g. not your personal OneDrive, you may run into sharing issues.
The first issue is, you're referring to an individual file.
The next is, you're using the local reference to the OneDrive folder, which won't refresh without a gateway once it is published to the service.
We can fix both of these at once.
Whether you use OneDrive or SharePoint the step will be the same.
Your Source step will be something like...
SharePoint.Files("https://yourdomain-my.sharepoint.com/personal/your_name_your_domain", [ApiVersion=15])or if SharePoint...
SharePoint.Files("https://yourdomain.sharepoint.com/sites/your_site_name", [ApiVersion=15])You should then get a list of files on the site.
Next step, filter to only show the ones you want, this is usually done by folder/file type etc.
Once you've done that and you're happy you're only showing the files you want to combine, click the combine button and watch the magic start to happen.
Any common transforms you need to do, i.e. changes you want done to all files, get done in the 'Transform Sample File' step. This then replicates to all the files automatically.
There are other tips and more concise ways to do it but they are more advanced. I think this is a good starting point.
Hi KNP ,
The process you gave me worked to upload the files once the Power Bi is refreshed, but is replacing the date on the existing data. I was expecting to have a stackde bar per each day, instead I'm having only one stacked bar but with the double of registers and everything with the same date.
Is there a way to avoid the data overwrite?
I assume is the way I'm adding the date with the step formula in the Transform Sample File:
= Table.AddColumn(#"Replaced Errors", "Add Date", each DateTime.Date(Date.AddDays(DateTime.FixedLocalNow(),-1)))
and the filter used to select the files
= Table.SelectRows(Source, each Text.Contains([Folder Path], "https://******.******.******/sites/Network/TechDev/Public/Performance/Data"))
- KNP3 years ago
Super User
Yeah, so that will add the same date for every row in every file.
What you need to do is...
Go to your "Removed Other Columns1" step and ensure you keep either the 'Date created' or 'Date modified' (whichever makes sense for your scenario). Power BI removes all columns except the content column by default when using this automated method to combine files.
Then, when the expand happens, you'll have a date specific to each file against every row.
I hope that makes sense. Let me know if I need to explain that in more detail.