Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KasperJ90
Helper III
Helper III

Update data in Excel file with PQ linked to another workbook

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?

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

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:

vangzhengmsft_0-1637822913354.png

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.

View solution in original post

1 REPLY 1
v-angzheng-msft
Community Support
Community Support

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:

vangzhengmsft_0-1637822913354.png

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.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.