Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello All,
On a daily base I get an excel extract from the past week. What I then need to do is remove the past 6 days from my existing data file and paste the 7 days I received in the latest extract. This because the data can change during the week.
So data 11 =>17th of the month gets deleted, and replaced with 11-18th of the month I received in my new file.
Day after, 12 to 18 removed, 12 to 19 added from the newly received file, rince and repeat.
Is there a way to automate this in power Query instead of updating the 'big' excel file daily?
Many thanks in advance!
KR,
Nico
Solved! Go to Solution.
Coding the extract date into the file name and then parsing it out is more reliable, as certain operations can futz with both the created and modified dates.
Coding the extract date into the file name and then parsing it out is more reliable, as certain operations can futz with both the created and modified dates.
Hi @Nico_Beckers ,
I'd just dump every Excel file into a network or SharePoint folder and, in PBI Desktop, use the Folder/SharePoint Folder connector to that folder.
Once connected, choose the 'Combine & Transform' option.
In Power Query, you can then adjust the standard combined query code at the Source step to filter the [Folder path] column to your document storage location, and also adjust the Remove Columns step later in the query to keep the [Date Created] column:
Once you've completed your generic transformations in the Transform Sample File helper query, you'll be able to filter or group the main output query to only keep the row that has the latest [Date Created] value for each unique combination of dimensions.
...or, even simpler, just filter the [Date Created] column at the Source step something like this:
Date.From([Date created]) >= Date.AddDays(Date.From(DateTime.LocalNow()), - 7)
Pete
Proud to be a Datanaut!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
13 | |
12 | |
12 | |
12 |