Automate your monthly folder path updates in Power Query.

If you're an accountant managing month-end reports, you know how tedious it can be to manually update the folder path in Power Query each month.

3 min readMicrosoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

This is the kind of problem that makes you wonder if the AI assistants you're using have ever actually done your job. An accountant sitting in month-end close, with reports piling up, asks for a simple automation: update a folder path so Power Query grabs the right month. Copilot and Gemini hand back code that doesn't work. That's not helpful. That's a waste of your time, and time is the one thing you don't have during close.

Here is what we think: the solution should not require you to become a Power Query developer. You already built a working query. You already understand the logic. The only friction is a manual path update that feels like it belongs in 1999. The issue is that every AI tool you tried assumed you wanted a clever, complex formula. What you actually need is a straightforward, repeatable method that respects how your folder structure works. You don't need a "revolutionary" approach. You need a function that reads the current month number from your system date, formats it as two digits, and plugs it into the folder path you already use.

Let's be practical. In Power Query's M language, you can use `Date.Month(DateTime.LocalNow())` to get the current month number. Wrap it in `Number.ToText()` and pad it to two digits with `Text.PadStart()`. Then concatenate that into your base path. The code looks something like this:

``` let CurrentMonth = Text.PadStart(Number.ToText(Date.Month(DateTime.LocalNow())), 2, "0"), Source = Folder.Files("C:\Users\wakiarg\THE COMPANY\THE SHAREPOINT - Documents\2026\2026-" & CurrentMonth & "\") in Source ```

That is it. No `CELL` functions. No SharePoint URL parsing. No broken code from an AI that doesn't understand your folder naming convention. You keep your existing transformation steps; you just replace the hardcoded path with this dynamic reference. When February ends and March begins, the query automatically looks at the `2026-03` folder. Your only task is to drop the files in the right place.

The takeaway here is straightforward: the best automation is the one that removes a single pain point without creating five new ones. You don't need a tool that promises to rethink your entire workflow. You need a tool, or a snippet of code, that respects the workflow you already have. This fix takes less than five minutes to implement, and it will save you that same five minutes every month for the rest of the year. That is not a game-changer. That is just a sensible improvement. And it is the one that actually works.

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

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.

Read the original at Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community