2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

How to dynamically change folder path in Power Query each month?

Hi, I’ve been struggling with this for hours. Copilot and Gemini keep giving me code that doesn’t work.

I’m an accountant, and during month-end close I usually compile several reports and paste them into a folder. Then I run a simple Power Query that reads, transforms, and filters the data into a final table.

It works perfectly.

The issue is that every month I copy and paste the files into a new folder, and I have to manually edit the directory path in Power Query — for example:

C:\Users\wakiarg\THE COMPANY\THE SHAREPOINT - Documents\2026\2026-01\

Then I change it to 2026-02, 2026-03, and so on.

Is there a simple way to modify the M code so Power Query automatically detects the current month folder (e.g., -02, -03, etc.) instead of me having to manually update the path each time?

The IA gave me some ideas using =cell but it's giving me an URL instead of the local directory, and from there on its a mess.

Ideally, I’d like it to dynamically reference where the file is stored, as the folder is always there.

submitted by /u/wakiarg
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#generative AI for data analysis
#natural language processing for spreadsheets
#real-time data collaboration
#no-code spreadsheet solutions
#rows.com
#big data management in spreadsheets
#conversational data analysis
#Excel compatibility
#financial modeling with spreadsheets
#intelligent data visualization
#real-time collaboration
#data visualization tools
#enterprise data management
#big data performance
#Excel alternatives
#data analysis tools
#data cleaning solutions
#Power Query
#folder path
How to dynamically change folder path in Power Query each month?