Share via

dynamic query refresh (power query)

Anonymous
2024-02-09T15:39:36+00:00

so my source file points to a dated folder and file name

eg. c:\daily files\feb\09\sample09.xlsx

so ofc the next day it'll be different....if i refresh the query, it wont work because it's still pointing to feb 9

is there a dynamic way to refresh this? or is manually editing the code in powery query the only way? not ideal imo

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2024-02-09T16:42:35+00:00

    The usual way is NOT to have the source in different folders or files. Copy the current source file into the SAME folder with the SAME name, issue gone.

    If you want the query to read a different file, you have to build a parameter table and use VBA/formulas to generate the path\filename in a cell.

    Building a Parameter Table for Power QueryThe Excelguru Blog

    Andreas.

    Was this answer helpful?

    0 comments No comments