r/ExcelPowerQuery • • Mar 06 '25

Merge efficiency based on size?

3 Upvotes

I have 3 files, each file is related but is in increasing granularity. One is (invoices) where I have an invoice number and total. 1 row per invoice and has the least amount of rows of the 3 files. The second is an (items) file which contains 1 row per item on each invoice, it has the 2nd most rows of the 3 files. The last is a (purchases) file that contains a row for every purchase with the customer and quantity of each item from each invoice that was purchased. For the most efficient query, should I use the invoices as the base, join the items table to it, then join the purchases to that result? Or the opposite where the purchases is used as the base then join the items to it and then join the invoices to that?

So (Invoices) has invoice # 12345 and total of $50.00. (Items) has invoice with invoice # 12345 and item “pencil” 1 pack of 100 price $10 and item “pens”, qty 1 pack of 500 for $40. And the last file (purchases) has customer A bought 30 pens, customer B bought 20 pens……?


r/ExcelPowerQuery • • Jan 21 '25

Identify strings with text from a list

3 Upvotes

I have a data set that we need to identify potential matches based off of a list of text strings. To clarify, the data looks something like this:

DateCategoryNotesOwner
1/1/2024FooLorem ipsum ABC dolor sit ametJohn Smith
1/1/2024Fooconsectetur adipiscing elitJane Doe
1/2/2024Barsed do ABC eiusmod tempor incididunt ut labore et dolore magna aliquaJohn Doe
1/2/2024FooUt enim XYZ ad minim veniamJane Doe
1/3/2024Barquis PDQ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequatJohn Doe

We have a list of matching terms already defined (and can be added to at any time) in Power Query that looks like this:

Terms
ABC
XYZ
PDQ

What I need to do is create a column that takes a look at the "Notes" column and looks for any of the entries on the Terms list and returns a TRUE/FALSE, like so:

DateCategoryNotesOwnerMatch
1/1/2024FooLorem ipsum ABC dolor sit ametJohn SmithTRUE
1/1/2024Fooconsectetur adipiscing elitJane DoeFALSE
1/2/2024Barsed do ABC eiusmod tempor incididunt ut labore et dolore magna aliquaJohn DoeTRUE
1/2/2024FooUt enim XYZ ad minim veniamJane DoeTRUE
1/3/2024Barquis PDQ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequatJohn DoeTRUE

This is, unfortunately just barely outside my experience. I found the following formula to use in the custom column while scouring the 'net for a solution, but it just returns a not-quite-error message ("function (c as any) as any") and I don't quite know enough about this level of Power Query to make sense of that message:

(C) => List.MatchesAny(Terms, each Text.Contains(C[Notes], _))

(I have no idea what the (C) is about, so I'm betting that's where I'm going wrong here)

Can someone help me figure this out, please?

EDIT: I figured out what was going wrong; the Power Query GUI was adding an "each" after I was adding the above mentioned query line to the custom column dialog.

Once I removed the extra "each" the code worked as intended.


r/ExcelPowerQuery • • Dec 01 '24

Save templates

3 Upvotes

Good morning, How to save query templates for later use and only change the data source. Thank you very much Good day.


r/ExcelPowerQuery • • Nov 11 '24

Pulling modified date information into Query output

3 Upvotes

Hi, I've built a query for tracking and summarizing certain data developed through multiple estimates my company is working on. The estimate software can export information as a ".XLSX" sheet. I've dumped these sheets into a particular folder. My goal is to be able to compare parts of the estimates side by side for various purposes.

The data I'm working with pulls in alright. The one thing I wanted to do was bring in the date (possibly time also) that each reference file was pulled into the folder, i.e. I can show Estimate A was exported 11/4/24 while Estimate B was exported 11/7/24. Is the best option just do a separate query that references that data without digging into the files themselves or is it possible to pull that into my comparison tables?


r/ExcelPowerQuery • • Nov 07 '24

Referencing vs Duplicating? Need advice.

3 Upvotes

I posted this in r/excel as well...

Hello - first time posting on this sub... I have also checked out a few articles about it but I am still not sure what would be be the best approach. Also, my apologies if I am using the wrong flair..

I am accessing some extracts that are stored in an Azure BLOB storage. I need to access 20 extracts of the same file (script runs that produces these daily extracts). The desired outcome is to have 20 queries (and tabs) to show the data per day. I was thinking of loading all 20, combine them together, do my transformations then reference that query to filter let's say Day 1 and load it into excel, then do the same for day 2, day 3.

Will it be more efficient to do it that way or duplicate the query? Just to add, I am thinking of doing the transformations on the initial query (combined data), then filter the days on the sub queries.

I only taught myself power query and I must admit that query efficiencies is not my strong suite. Appreciate the insight and help in advance!


r/ExcelPowerQuery • • Oct 28 '24

Power Query date filter works when selecting from the date-picker, but not when using a cell value as a parameter

3 Upvotes

Hi!

As stated in the title, when I set a date filter on a date chosen from the date picker in the PQ editor, the data loads successfully

When I try to use a Parameter based on a sheet value, no records are returned

If I use a formula to check whether Excel considers the value in the date column to be the same as the value entered into the cell the parameter is using, Excel agrees this is TRUE

And the same parameter works in another PQ exactly as expected, so I know it's not an issue with the config of the parameter

I've been wrestling with this for a whole day now, so I thought I'd post here to see if anyone can point me in the right direction

TIA


r/ExcelPowerQuery • • Oct 23 '24

Combining files from folder and transforming

3 Upvotes

Hi everyone, I am looking for some advice. Sorry in advance for a wall of text.

I have a folder directory that has 300+ files. Each file represents a day with most weeks having 4 days. I have a table on each one that is always the same structure. I have these connected and it WAS really slow. Understandable honestly, but because each file includes the date it was for I was able to identify Day, week, period and year. Then filter before expanding the table to make it MUCH faster than the earlier iteration.

I have this combined table loaded to the spreadsheet in order to not reload after each subsequent transformation or connection to the query.

The problem I am having is it is still really slow to transform.

I attempted a few in PQ and then I tried in Access. It seemed better at first, but I have my issues with Access as well.

If you had a choice would you use PQ or Access?

I have a laundry list of information I am being asked to obtain from this data and I have more I can get I am sure.

The two I am having the most issue with is first seeing a way to make it dynamic to work for years to come. Then taking a query/table with information for say 2023 and 2024 that is in columns and making the first columns the lower year and the second columns the later year.

tl;dr PQ vs Access for numerous and potentially complex calculations on a data set that is 60,000 records and growing.


r/ExcelPowerQuery • • Sep 29 '24

PQ slow

3 Upvotes

My work(environment) is restricted to Excel 2016 and max 4Gb of memory for the program. When using PQ I usually experience it to be slow. Specially when merging queries.

Anyone have tips I can keep in mind when making queries to make PQ load faster?


r/ExcelPowerQuery • • Sep 16 '24

Convert a query into a "dynamic" parameter

3 Upvotes

I'm in great need of assistance because I can't figure this out with my googling skills and ChatGPT.

I want to use parameters to filter multiple queries and I want to do so without the user having to go in the PowerQuery Editor. Here's my idea so far :

  • Create an excel sheet named "Parameters" where the user can select the parameters from a restricted drop-down list.

  • Import this sheet in PowerQuery, keep only the data that will be used as a parameter which is only one cell.

  • Convert the previously created query from a table to a parameter and use said parameter to filter all of the other queries it's used into.

Problem is I can't figure out how to convert my quey into a parameter that will refresh its value according to user input when you refresh the workbook.

I figured how to do it with a VBA macro that modifies the value of the parameter I want to modify and then refreshes the workbook but it's too heavy for my liking. Is there a way to convert a table into a single point of data that is a parameter and that when the excel workbook is refreshed will filter my queries accordingly ?


r/ExcelPowerQuery • • Sep 08 '24

Power query learning

3 Upvotes

Hello can anyone teach me how to use power with a template file


r/ExcelPowerQuery • • Aug 20 '24

Lateral Thinking

3 Upvotes

Hey everyone
Im interested if anyone has a flow chart they use to guide through a structured problem-solving process.
A few times in recent months, I've had complete laser focus on a data structuring issue. It wasn't until speaking to colleagues and they offered alternate options which were adjusting the original excel workbook and provided faster options, or a mitigation to the problem.

Understandably, this doesn't always achieve the outcome, but a guide may assist in breaking out of a lengthy method, and quickly consider and explore alternate methods.

Essentially, a process to think more laterally.

I'm hoping this will be more efficient and consistent. Well, it has to be more efficient than my last highly taxing approach to deal with a poorly structured workbook with an ungodly amount of headers 😐

If anyone has found a particular flowchart useful and happy to share, id be very grateful.
Many Thanks


r/ExcelPowerQuery • • Aug 14 '24

null values when merging queries

3 Upvotes

hi,

I am trying to merge some tables that have I have queried in SQL from my database to a customer sales file - the queried tables contain information relevant to me and will better allow me to identify sites/products etc better. When merging them the details match however when I add a new set of data e.g a new weeks sales file the merges dont work and I get null values both on the original table and on the merged data - any ideas what would be causing this or how to resolve it?


r/ExcelPowerQuery • • Aug 11 '24

Power Query

3 Upvotes

Hi Guys. Could you please assist me with a solution for quite a challenging condition I would like to create in power query. So I download files for campaigns ran within a week for analysis, but the dates on files change weekly. For instant that would have a start and an end date, example (in a strange format) 11_18082024 which is 11 August to 18 August 2024. I am only interested in the end date (18 August 2024) as I always have to manually change in excel but I want it to be done in power query. Please help. I tried add column and custom column but they seem to be limited functions. Thank you in advance.


r/ExcelPowerQuery • • Aug 09 '24

How to Merge Rows Based on Another Column in Power Query?

3 Upvotes

I have a worksheet of common ophthalmic drugs and their details. I plan to append this worksheet with another worksheet for systemic drugs via Power Query, to be used as a reference database for various other worksheets.

I'd like to merge all of the brand names for each generic drug into the same cell, separated by a "," but can't figure out how to do it. I don't really understand pivots yet.

Any help would be much appreciated!


r/ExcelPowerQuery • • Jun 17 '24

Power Query Source

Post image
3 Upvotes

Hi,

I have an Excel Consolidated File that is built using Power Query and is living in my One Drive. The source data that it is using is also in a folder for raw data within my One Drive. I want to transfer Excel file and the raw data folder it to a Sharepoint List.

What is the process of changing the source path in my Excel Consolidated File once I have transfer it to the sharepoint list? I want to make sure that the Excel Consolidated file references the Raw Folder Files as it was in my One Drive.

Thank you for the answer.


r/ExcelPowerQuery • • Jun 16 '24

Group rows based on criteria into one row and several columns at once

3 Upvotes

Hi,

I have a large source table which looks like this (simplified example, in fact it has 114 columns and approx. 16 thousand lines):

I need to convert it into table like this:

It means I need to:

  • group the rows according the Order to get the total order quantity,

  • add columns with per year order quantity (aka group into columns according to Order & Year) and

  • add some useful columns from the source table (Model in example) and omit the not useful ones (Type in example); please note these columns contain same value for each single order, see the example.

I already did it, but as I'm new to Power Query, my solution is terribly slow, almost not usable. I grouped the table by order to get the total qty per order and then I'm searching in the source table (using Table.PositionOf function) the for the per year quantities and values of the other useful columns and I'm placing them into new columns for the given order.

I'm looking for the better and faster Power Query solution. But this is already outside my knowledge.

Thx in advance for any idea.


r/ExcelPowerQuery • • Jun 14 '24

Automation

3 Upvotes

Hi everyone,

I am currently working on transforming and combining multiple sheets within one Excel workbook. I have 4 queries, 3 of them referring to their own data set and one that is a merge out of two of the transformed queries. I created a parameter with the file path that all of the queries use. I only need the output of the last. The thing is that I have many files which I need to transform this way and then combine all the final outputs in one table. I just started working with PQ a week ago and was wondering if there is a way to automate the plug in of the file paths (they are all in one folder)

Thank you!


r/ExcelPowerQuery • • Jun 12 '24

Self-refencing Power Query Table but without Unique ID column - Is this possible?

3 Upvotes

Hi,

I have a tab (Source table) that contains a table synced with multiple workbooks (used by different people). In the country column, there are multiple values per cell separated by a delimiter. Example: Australia; Belgium; Canada. This is why I use a Power Query (PQ) table to separate the countries per row and whenever someone enters new data, I can just refresh the PQ table.

Problem is, I need to manually add columns in that PQ table that are not part of the original query. When I refresh, it messes my table and the values in the manually added columns are not aligned with the correct row of info. Assigning a unique ID would be impossible because the column is delimiter-abled from the Source table. So assigning per row would give the same ID per country of that cell.

Do you know a workaround please? I badly need your help.

Edit: To give more context, below are the tables I'm referring to:

Source Table:

FruitCountry
AppleJapan; USA
MangoJapan; Philippines

Power Query table from Source Table - This is to separate the countries per row. Has an auto-refresh because new data comes in everyday to the source table:

FruitCountry
AppleJapan
AppleUSA
MangoJapan
MangoPhilippines

The problem (1/2): each country leader goes to this file and filters their country to give feedback regarding that fruit. So a column (Feedback) needs to be added at the end of that PQ table.

FruitCountryFeedback
AppleJapanIt's Yummy
AppleUSA
MangoJapanIt's Yummy
MangoPhilippines

The problem (2/2): Since the manually added column is not a part of the original query, whenever the PQ table gets refreshed, rows of the feedback column gets misaligned with their correct fruit and country info. The It's Yummy feedback should be for Apple Japan and Mango Japan. The cell location stayed the same for the feedback rows but not for the PQ table itself.

FruitCountryFeedback
AppleCanada (new data trigerred by the refresh)It's Yummy
AppleUSA
MangoPhilippinesIt's Yummy
MangoJapan
AppleJapan

r/ExcelPowerQuery • • May 10 '24

Transform table into shown format (Please see pic)

Post image
3 Upvotes

Sorry if this is basic, I can't seem to figure out how to do this with the unpivot method. Thank you in advance for helping a beginner.


r/ExcelPowerQuery • • Oct 28 '26

Trying to use Power Query to filter JSONs but can't get far

Thumbnail
reddit.com
2 Upvotes

r/ExcelPowerQuery • • Jul 31 '26

Bank reconciliations in Power Query…

2 Upvotes

seem to be harder than I anticipated. Anyone have any success with this? The descriptions for my book items and bank items can be pretty dang different. As well as the dates.

Any feedback would be much appreciated!


r/ExcelPowerQuery • • Apr 29 '26

Refresh

2 Upvotes

How can I check why the update of a query set in Power Query is being blocked? When I update them individually, they all work fine. When I do a full update, the update gets stuck.


r/ExcelPowerQuery • • Apr 07 '26

Any experience or guidance on 403 errors when trying to pull data via PowerQuery from Fangraphs? It keeps giving me a redirect error.

2 Upvotes

I was trying to link to the site below, but it keeps giving me redirect errors. Any thoughts on how to fix it? It could be a permissions error but Fangraphs should be public yeah? https://www.fangraphs.com/leaders/minor-league?pos=all&level=0&lg=2,4,5,6,7,8,9,10,11,14,12,13,15,16,17,18,30,32&stats=bat&qual=0&type=0&team=&season=2026&seasonEnd=2026&org=&ind=0&splitTeam=false&players=&sort=18,1&pageitems=2000000000&pg=0