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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.