Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I created a Excel file that is getting data from another Excel file located in our shared folders. I want that when someone copy in a new file to that location (with same name) then my Excel file automatically updated PQ/Tables with the data from the new file.
How do I do that?
Solved! Go to Solution.
Hi, @KasperJ90
After my testing, this is done automatically.
When you copy a new file to replace the old file in the same path, and you click Refresh button in Excel, then it will automatically get the data from the new file.
Whether you are getting data from an Excel file or from a folder, make sure that the steps for getting data from a file are the same in PowerQuery, then when you replace the old file, the file path is the same and all the query steps are the same, you will automatically get the data from the new file after you click Refresh.
Result:
code:
let
Source = Excel.Workbook(File.Contents("C:\Users\Administrator\Desktop\Shared folder\file.xlsx"), null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Table1_Table,{{"Date", type date}, {"Value", Int64.Type}})
in
#"Changed Type"
let
Source = Folder.Files("C:\Users\Administrator\Desktop\Shared folder"),
#"C:\Users\Administrator\Desktop\Shared folder\_file xlsx" = Source{[#"Folder Path"="C:\Users\Administrator\Desktop\Shared folder\",Name="file.xlsx"]}[Content],
#"Imported Excel Workbook" = Excel.Workbook(#"C:\Users\Administrator\Desktop\Shared folder\_file xlsx"),
Table1_Table = #"Imported Excel Workbook"{[Item="Table1",Kind="Table"]}[Data]
in
Table1_Table
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @KasperJ90
After my testing, this is done automatically.
When you copy a new file to replace the old file in the same path, and you click Refresh button in Excel, then it will automatically get the data from the new file.
Whether you are getting data from an Excel file or from a folder, make sure that the steps for getting data from a file are the same in PowerQuery, then when you replace the old file, the file path is the same and all the query steps are the same, you will automatically get the data from the new file after you click Refresh.
Result:
code:
let
Source = Excel.Workbook(File.Contents("C:\Users\Administrator\Desktop\Shared folder\file.xlsx"), null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Table1_Table,{{"Date", type date}, {"Value", Int64.Type}})
in
#"Changed Type"
let
Source = Folder.Files("C:\Users\Administrator\Desktop\Shared folder"),
#"C:\Users\Administrator\Desktop\Shared folder\_file xlsx" = Source{[#"Folder Path"="C:\Users\Administrator\Desktop\Shared folder\",Name="file.xlsx"]}[Content],
#"Imported Excel Workbook" = Excel.Workbook(#"C:\Users\Administrator\Desktop\Shared folder\_file xlsx"),
Table1_Table = #"Imported Excel Workbook"{[Item="Table1",Kind="Table"]}[Data]
in
Table1_Table
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.