Forum Discussion
Daily File Update/Overwrite
Created a query to pull a daily csv file, for which I have no creation control, that is auto saved to SharePoint. With each new daily file I need to overwrite the dated data in the existing query table with the new file data. Each file has the same format and titled with the run date and file name (name does not change), that is...20231012_File Name, 20231013_File Name etc.
For example, if the existing query table has dated data from 1/1/2023 through to 10/12/2023 and the new day's cvs file has dated data 10/2/2023 - 10/13/2023, I need to, essentially, delete all rows in the existing query table having the dates 10/2/2023 - 10/12/2023, then add the new file 10/2/2023 - 10/13/2023 data to the existing query table. How can I accomplish this within Power Query?
Found a solution that worked for me....
5 Replies
- edhansCommunity Champion
- Get the dates from the new table.
- Create a list of those new dates.
- Use a filter. See https://www.ehansalytics.com/blog/2020/5/20/using-listcontains-to-filter-dimension-tables for an example. However, you will add a 'not' in front of the List.Contains() function to filter those records out.
- Append your new table to the existing data
- edhansCommunity Champion
My steps above were for Power Query. You need to provide us some examples so we can help.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
- MODUserFrequent Visitor
Found a solution that worked for me....