r/ExcelPowerQuery • • Aug 27 '25

Gpt 5 and m code

10 Upvotes

I’ve been writing m code for a year now. Almost always using llms to generate the code.

I feel like gpt5 has been a huge step up in m code writing! It’s using functions and is more clear about what it’s trying to do. Honestly it’s helping me appreciate what m code can do even more.

Are you guys seeing the same thing?


r/ExcelPowerQuery • • Jul 27 '25

Using VBA to create PQ Queries from scratch!

8 Upvotes

I LITERALLY just learned a NEW one today!

Had no idea VBA could be used to create a query from scratch in PQ.

Also, it can be used to delete ALL queries in my open workbook at the same time!

🤯

GAME CHANGER!!!

I just wish I could figure out how to make them save as a worksheet instead of just a connection via VBA.

What else can be done in PQ with VBA?


r/ExcelPowerQuery • • Jul 08 '25

I really need help with this Power Query...

Thumbnail
gallery
7 Upvotes

Hi all

(I’ve whitened out some data as this is company sensitive)

So, the issue i have is that i need to create a ‘simple’ planning on what day we can earliest receive containers at our company with the only rule that we can only receive 15 containers each day.

I took the following steps in Power query:

  • What i already did was create an additional column with the first possible delivery date which is just the arrival date at the terminal +1.

  • Added a column with an index number.

  • Added a column with a batchgroup (grouping containers per 15)

  • Then i added a working calendar on which days we are open and can receive the 15 containers.

With these steps i tried to calculate the earliest possible delivery date with the following formula:

= let calendar = WorkingCalendar[WorkingDate], eligibleDates = List.Select(calendar, (d) => d >= [FirstPossibleDate]), deliveryDate = if List.Count(eligibleDates) > Number.IntegerDivide([Index], 15) then eligibleDates{Number.IntegerDivide([Index], 15)} else null in deliveryDate

On first sight this seems to work and it groups the containers to a maximum of 15 containers / day.

But when i take a closer look it does not fill the containers to a maximum of 15 / day and sometimes just skips days or start on a new day when the previous day only has 4 / 15 containers planned when there are others that could be booked on the same date.

I don’t seem to find the solution here... I think i might have to do someting with the first possible date changing and it automatically chooses a new delivery date.

(See example of when it changes to 17/06 when it should be 16/06. And only 1 container on 18/06)

I would really appreciate any help on this!!!


r/ExcelPowerQuery • • Sep 06 '24

250 members! 🎉

7 Upvotes

Beautiful to see this community growing. Let's get the first thousand! 💪🏻

If there are questions, even the little ones, save your time and just make a post.

Regards, Phillip from DeclutterData 🙋🏻‍♂️


r/ExcelPowerQuery • • Oct 07 '26

Conversion of Access Database to Microsoft Power Query

6 Upvotes

Hi all,

New user here. I currently use MS Access DB for some energy tracking responsibilities for my job at a university. The Access DB is not overly complicated. We use it for monthly data entry (electrical/fuel oil/propane consumption values) and some rudimentry code to transform the energy data into building/campus energy consumption and for billing purposes. As Access is no longer supported by MS, I am wondering if anyone here can comment on the whether PQ would be a suitable alternative to Access.

Also, are there any online resources/support to help guide and convert an existing Access database to PQ.

Thanks in advance all.


r/ExcelPowerQuery • • Aug 14 '26

I inadvertently became the team lead in PQ as a novice and now they want me to host a lunch-and-learn

6 Upvotes

Fml. I was merely trying to be a problem solver as I despise manual, time-consuming, soul-sucking tasks. Not to mention overall stagnation/lack of resourcefulness. But now I can’t help but feeling like I’ve fucked myself.

I’ve essentially brute forced my way through a few automation projects out of shear stubbornness and hyper fixation. They were really well received and have saved my colleagues hours with the solutions, as the story goes.

I only started dabbling with PQ a few months ago, and now they are asking me to host a full-on lunch and learn to teach my team. Not to mention, some of the projects I worked on were in VBA, not even PQ. WTF?

I don’t think they appreciate that 1. I used the information that is available to ALL of us to create these tools without anyone teaching me (besides ChatGPT lol), and 2. I am still learning myself and it’s not a simple skill that I can train the team on in an hour.

While I’m always open to commiseration, my question is:

How can I leverage this situation as best as possible while also managing expectations and setting some sort of boundary for my own work/time?


r/ExcelPowerQuery • • Apr 15 '25

Power Query Beyond the User Interface - By Chandeep Chhabra - Review

6 Upvotes

Has any of you read the book referenced in the title? If yes, how is it? Can you please provide a quick review?


r/ExcelPowerQuery • • Mar 21 '25

I vowed at the beginning of the year to devote a few hours every week to automation of data

6 Upvotes

I actually achieved it this week on the verge of the second quarter with using Power Query. I combined multiple files to trace results of requests for information I have sent out since November.

At first I was getting the dreaded "key error" but I troubleshot it (there was one non-constent file in the folder).

I feel pretty good about this, in spite of the time it took away from my daily data refinement work. Goals are good. Working towards them-even better.

Happy Thursday!


r/ExcelPowerQuery • • Dec 29 '25

Load specific spreadsheets from various workbooks with different layouts

5 Upvotes

Hi all,

I am a fairly new PowerQuery user. With get data from folder, is it capable of identifying specific spreadsheets across different workbooks that have similar layouts to combine? It seems whomever set up the original data used different layouts in each workbook, so sometimes it’s the first worksheet, sometimes it’s the 3rd, the worksheets all have similar titles, but not the same, and there is a lot of other worksheets in each workbook which I don’t need to use for this particular task.

Is this beyond the combine and transform action in PowerQuery?

Thanks in advance.


r/ExcelPowerQuery • • Jul 04 '25

Scraping data from a web page?

5 Upvotes

I have heard it is possible to scrap data or download exports from web pages.

My work has recently purchased a new weight based inventory system called PAR Excellence to distribute our supplies to inventory rooms through our facility that staff pull what they need from.

So far, the transition has been a nightmare!

The company has a website that if you click on several links for each room it will allow you to download data in an xls file that excel recognizes as a csv but PQ will barf on if trying to read the file without me converting it to an xlsx file first.

I can’t highlight & copy data from the page, it will not work.

If I try to copy the link of the room and directly paste it into the web address bar it generates a skewed version of the page & won’t allow me to execute an export.

How can I make PQ click on each link in order to make the page display properly so that I can export ALL few hundred rooms worth of data one after another faster than I can do manually?

And how do I convert them to xlsx if PQ won’t recognize the xls file at all?


r/ExcelPowerQuery • • Jun 26 '25

Endless loading

5 Upvotes

I’ve been working with Power Query for some time now. The problem is that when I load a query into Excel—even if it’s just creating a connection—the loading icon keeps spinning. Does anyone have any idea how I can fix this?


r/ExcelPowerQuery • • Feb 25 '25

Adding a Manual Entry Column to a Power Query – Is It Possible?

5 Upvotes

Hey everyone,

I’m an Intake Coordinator for a healthcare organization, and part of my role involves running a daily report to triage patients and allocate admissions based on our availability for the following day. Previously, I was handwriting a large portion of this report, but I recently streamlined the process by creating a Power Query that pulls data from our electronic medical record system—cutting my manual work in half.

That said, there are still some key pieces of information that aren’t captured in any existing reports within our EMR, meaning they can’t be incorporated into the Power Query automatically. Instead of continuing to handwrite these details, I’m wondering if there’s a way to add a column to my existing Power Query where I can enter this missing information manually.

Has anyone tackled something similar? If so, what’s the best way to go about it? I’d love any insights or workarounds you’ve found helpful.

Thanks in advance!


r/ExcelPowerQuery • • Sep 07 '24

How do you organize and save your Power Query M code snippets for future use?

5 Upvotes

Hey folks,

I’ve been using Power Query a lot and have collected a bunch of handy M code snippets along the way. Just wondering how everyone else manages theirs for future projects?

Do you have a go-to tool or method to keep everything organized and easy to find when you need it? Would love to hear what works best for you!

Thanks!


r/ExcelPowerQuery • • 7d ago

Read Record Vs Table Join

4 Upvotes

Hello,

I’m learning PQ by myself and I’ve always used table joins when I wanted to fetch informations located in another table.

Recently I noticed that I often used "info tables" with only one record so I could easily turn these tables in a record instead.

Is it usually a better idea to use a Record.Field() over a table join any time I can ?

Edit : more data below

I want to integrate the code in my fact table.

I have two options :

I. I join table 1 with table 2 and use "Test" as the key

II. I transform the table 2 in a record and I use a custom column to read the record.


r/ExcelPowerQuery • • Mar 27 '26

Accountants

4 Upvotes

I’m exploring some new skills. What do you use Power Query for?? I started to tinker with it a little bit.


r/ExcelPowerQuery • • Mar 02 '26

Query Code

4 Upvotes

Can anyone help me here? I'm stuck on my code...

I'll try to outline it. I want to create an automated production schedule based on my recipes. These recipes are listed in a table with a code, preparation method, timing, and department. Each recipe is in a separate tab.

I now want to use this information to create a production schedule with a main column for the days of the week (Monday, Tuesday, Wednesday, etc.) and a subcolumn for each day with: code, preparation, timing, and department.

So far, so good. However, I also get a separate row for each subcolumn. And I don't want that. I want one row containing the information code, preparation, timing, and department. If you like, I can send you screenshots.


r/ExcelPowerQuery • • Feb 22 '26

Source document randomly pops up while using Power Query

Thumbnail reddit.com
4 Upvotes

r/ExcelPowerQuery • • Jan 21 '26

Excel Map Function to Hold Invoice Value and Payment Value then Adjust Invoice Value till Payment Get Zero

Thumbnail
reddit.com
4 Upvotes

r/ExcelPowerQuery • • Dec 12 '25

Most Common Power Query Pitfalls

Thumbnail reddit.com
4 Upvotes

r/ExcelPowerQuery • • Dec 11 '25

Is it possible to automate import of specified sheet and specifed cells into a database and to include the name of the file as a code?

4 Upvotes

i! I am working with an instrument that automatically exports all of my data into excel file with exactly the same formating/sheet number etc, and I will be having a lot of the same exports and I was wondering if it is possible to import information from sheet 3 from highlighted range? I know I will sometimes need rows below but always only those columbs. They are not formated as table and if I need to do so it would be just easier to copy paste.

Also, since I would be doing a lot of the same things, is there a way to copy the name of the file into database as a unique ID of the specific file? If so, if I do multiple repeats of the same thing (same name differnet values), could I specify that they are different runs to not overwrite them/lose information?
Thank you!


r/ExcelPowerQuery • • Aug 15 '25

Using power query to import pdfs to excel

4 Upvotes

Hi,

I am a total newbie at power query. I work for an organisation that has strict cyber security rules and I am unable to use VBA.

I have NAB bank statements (about 10 statements and they are 10 pages long each) in pdf that I need to convert to excel. Is this something that can be easily done with power query - keeping in mind that sometimes the formatting of the pdf can be inconsistent. I cannot access the excel versions of the bank statements - I can only use the pdf copies to review them. Please let me know if you need more information. Thank you!


r/ExcelPowerQuery • • Jul 11 '25

Tabular Business Case Model in Excel with Power Query

Thumbnail reddit.com
4 Upvotes

r/ExcelPowerQuery • • Jul 06 '25

Function mcode repository

4 Upvotes

I’m been trying to use a centralized code depository for my M code. My office environment restricts add in pluggable code and I had to do a roundabout VBA solution that takes the text of the code from a column and imports it into any workbook that I run the VBA code also in my environment, I’m not able to run VBA code or store it. I have to copy and paste the code every time I open a new workbook. Has anybody else encountered this and what was your solution?


r/ExcelPowerQuery • • Jun 19 '25

Combining data from files with 1 dynamic column name.

4 Upvotes

Beginner here. I’ve done some YouTubing but haven’t quite found a helpful answer.

I’m combining data from a folder from different files. The combining goes great, but every month one (out of fifty) column names changes to be “…as of (current month name)”.

I do not need the data in this particular column.

When I exchange the files on my folder with the versions from a new month, this one changed column name no longer existing prevents the update.

Any advice, or can you point me in the direction of a good YouTube solution?

Thanks