r/ExcelPowerQuery • • Apr 29 '25

Cannot convert the value to type Text

4 Upvotes

I'm trying to combine the values in the joint venture number column by shared file name.

I've played around with adding Text.Combine to the formula, but it's not functioning properly since there isn't a pipe delimiter in the cells with a single joint venture number.

Is there a way to combine the cells with a single joint venture number with the cells that have multiples joint venture numbers using power query? I still need the pipe delimiters to exist in the combined cells.


r/ExcelPowerQuery • • Jan 15 '25

Forget VLOOKUP! Fully Automate Table Comparisons with Power Query

Thumbnail
youtube.com
4 Upvotes

r/ExcelPowerQuery • • Sep 30 '24

Performance issue with nested merges

4 Upvotes

I work in accounts receivable.

My current task is to take a medium size dataset (around 100k rows of data) and do matching of debit and credit based on values, account numbers etc. The problem is that I do multiple types of matching from the same dataset and I keep duplicating the queries to then filter out the matched values from other queries. After the 4th nested query the loading time is largely increased. Does anyone have an idea of how to speed things up?

High level overview:

  • load excel file to PQ

  • do some transformations

  • referece query, find first match with inner

  • merge as new original dataset with the matches -reference again -repeat this process for each rule

I've looked a bit into DAX and I'm thinking maybe loading to data model and use DAX would be faster but so far I've only seen tutorials which replace the vlookup function, any input would be appreciated!


r/ExcelPowerQuery • • Sep 18 '24

Columns contain data that should also be columns

4 Upvotes

Ok i am very new to using power query and I am trying to import a folder of XLS files into power BI.

I have transformed the data following along with several youtube videos.

The issue is that there is data in columns that should be headers.

Attached is an image after i removed the name column and promoted the first row to headers.

This image is just to show the name column in case it helps...

Any help would be appreciated or if you have a video source that might explain how to fix this problem. Chatgpt is not helpful at all and I have spent like 3-4 hours trying to figure out what to do. I am sorry if this is a dumb question or if i posted in the wrong area. Any advice or help is greatly appreciated!


r/ExcelPowerQuery • • Sep 03 '24

Power Query updating new rows but not changes to old rows

4 Upvotes

I created a query that pulls together data from multiple tables over multiple worksheets. The data on each worksheet is regularly being updated with new rows of information being added and old rows being updated. Each row pertains to a specific individual/case.

The problem I am having is that when I refresh the Query Table, it adds any new cases (rows) that have been added to the source tables, however it doesn't update changes to data in rows that were already there. E.g. Updating the 'Case Status' column from 'Ongoing' to 'Case Closed' on a given case. The only way around this is to make manual changes to individual cells in the Query table to reflect the data in the source tables. This Query is linked to Pivot Tables and Charts on a dashboard, which is supposed to be updated automatically. How do I get the Power Query table to update changes to the old information as well as updating new rows?


r/ExcelPowerQuery • • Aug 28 '24

Record Offset in Power Query

4 Upvotes

Excel Version: 365

I have a table of data that contains a flattened hierarchy structure that contains Codes and Names.

At the lowest level, the code is 4 or 5 digits (a number).

At the next level up, the code ends with '_4' with the next level ending '_3' etc.

For each of the lowest level entries, I want to create columns that contain the code and names of each of the preceding levels.

Example Data:

CodeName1 Up2 Up
ABC_1Boss Level
DEF_2Number 2ABC_1 Boss Level
DEF_3Tier 3DEF_2 Number 2ABC_1 Boss Level
12000Business UnitDEF_3 Tier 3DEF_2 Number 2
12300New business unitDEF_3 Tier 3DEF_2 Number 2

Basically I want to calculate the columns 1 Up and 2 Up (etc...) based on the structure in the Code column.

Suggestions and ideas welcome.


r/ExcelPowerQuery • • Aug 19 '24

Problem pulling data from Google Sheets

4 Upvotes

Trying to figure out how to pull data from Google Sheets into Excel using PQ. From what I have found, this is the basic way:

let
    FileID = <<Insert FileID here>>,
    BasicURL = "https://docs.google.com/",
    RelativePathString = "spreadsheets/d/" & FileID & "/export?format=xlsx",
    //Also tried: RelativePathString = "spreadsheets/d/" & FileID & "/export?format=xlsx&id="&FileID,
    Source = Excel.Workbook(Web.Contents(BasicURL, [RelativePath=RelativePathString]), null, true)
in
    Source

When I try this, I get the message "We could not evaluate this query due to invalid or missing credentials." with the option to configure the connection.

When I follow that path, I can choose "Authentication kind" = "Basic", enter my credentials, and click Connect. Spinning circle, then back to the same error message.

Thinking it might be a 2FA issue, I created an App Password and tried it that way, but same result.

I've seen some comments about publishing the data set to "Anyone with the link can view" but this is pretty sensitive data so not comfortable with that.

Has anyone managed to get this to work without publishing the data openly?

ETA: I went ahead and tested this modifying the share to "Anyone with the link can view", and when I do that things work. But like I said I don't really have the option of running the real data this way. But that seems to confirm that the other aspects of the approach work.


r/ExcelPowerQuery • • Sep 24 '26

Built a Power Query setup that handles schema changes instead of hoping next month’s file is identical

Thumbnail
reddit.com
3 Upvotes

Got tired of trying to build "bulletproof" Power Query setups that eventually break anyway. Instead, I set one up that adapts to source drift when it can, or breaks intentionally when critical stuff is missing—and logs what changed either way.

​Here’s how I tackled it:

​File & sheet guardrails: Filter out ~$ temp files, bad extensions, and hardcoded tab names so random file changes don't crash it.

​Cleanup & headers: Clear top clutter, trim whitespace, fix locales, and use Table.RenameColumns(..., MissingField.Ignore) for shifting headers.

​Schema drift: Use List.Difference to flag new columns in a Schema Alerts sheet, plus List.Distinct(List.Combine(...)) to grab dynamic headers across files.

​Data quality & controlled breaks: Swap TBC, N/A, and - to null so math doesn't blow up, but let the query hard fail if a core column goes missing.

​Put together a full step-by-step build video if anyone wants to see the code/setup: https://youtu.be/SiX0wnpR5yg?si=RG23oHGEldTrh6Dq

​How are you guys handling schema drift in your recurring PQ jobs?


r/ExcelPowerQuery • • Jul 31 '26

I use Power Query in Excel, and my source data is stored in OneDrive, which is synced to my PC. If I move to another PC, the file path changes and Power Query may no longer detect the source. I also need to share this Excel file with colleagues, and each of them has OneDrive synced to their own PC.

3 Upvotes

r/ExcelPowerQuery • • May 19 '26

Need A PQ Master

3 Upvotes

Hi friends. I am doing a project for work that I need a power query master for. I am attempting to create a template tool that can be used by different users every month (they would make a copy of the tool for their use) but I need to be able to load a list of search terms (either in the source file or in the actual pq tool) and a date range so that the tool only spits out the relevant data to the list of terms and the date range. I think I am confusing Copilot and ChatGPT because I want to use TWO separate files (one as the source of data and one as the tool itself) and connect them through the data source settings. Can anyone help me? I can commission this task as well if you don’t want to teach a newbie like me.


r/ExcelPowerQuery • • Apr 20 '26

Power Query on MS Teams

Post image
3 Upvotes

Hi!

At work, I've been tasked with (if possible) creating a powerquery that pulls information from a master excel file. The point of this is to remove private data from an HR tracking file so that leadership can review the file without exposing confidential or unnecessary data.

It is an employee activity report so, it's updated frequently.

At first, I tried making it in MS Teams, since the master file was on the Teams channel as well. This didn't seem to work because of slow updates and because the channel was private. I didn't get far at all.

So, I tried putting the Master Excel on our network in HR's restricted folder and doing the PQ on teams. I got fairly far, and it seems to work if I have both files open. However, as soon as I close the master, it gives an error when you try to refresh (see photo).

My assumption is because of the different accesses, but I am not sure.

Does anyone have any ideas on how I can get this to work?

Much appreciated!


r/ExcelPowerQuery • • Apr 10 '26

Is it possible to import data from multiple Excel sheet with missing or wrong order columns?

3 Upvotes

I am trying to connect information from multiple Excel sheets, but some sheets have more properties than the other, and some have the same properties but in different order. Is there any way to combine them using 1 PQ anyway? E.g. if columns are missing to auto leave them blank, and if they are in a different order to rearange based on the column name?
The property name would always be exactly the same as it is export from a different application.


r/ExcelPowerQuery • • Apr 03 '26

Token Refresh Timeout bug

Post image
3 Upvotes

If you’re seeing this error on your refresh when loading to Table it’s not just you

Please send a report back to the Excel team immediately after closing error message : help - feedback - report a problem

Token Refresh Timed Out


r/ExcelPowerQuery • • Mar 05 '26

Table.Buffer before Removing Duplicates order of operations.

3 Upvotes

I used to add a step that just buffered the table after a sort before removing duplicates. I had the idea to save a step and wrap the Remove Duplicates step with the Table.Buffer, but now I am wondering if that is buffering after the dupes are removed, so maybe I should wrap the Sort instead.

Rather than figure it out on my own, i figured I'd bother you nice people about it.

I guess the bottom line question is, when you nest steps like that, what is the order of operations? My thought is that it does the inner most (function) first.


r/ExcelPowerQuery • • Jan 22 '26

Multiply to ranges together

3 Upvotes

Multiply Two *

Hi, I am looking for some guidance as to how to multiply two ranges together.

one range contains names, salaries, benefit costs, etc. the other range contains names, and a number of columns with percentages

if I append the two ranges together by name, they connect correctly, but I just don't understand how I would be able to multiply the column in one range by all the columns in the other range and so forth.

the end result would be a range of rows where of a * b columns in length (where I have let's say four columns that I need to multiply 100 columns)

any guidance would be appreciated


r/ExcelPowerQuery • • Nov 28 '25

Need help calculating KPI using WORKING DAYS ONLY between two dates (Power Query or Excel)

3 Upvotes

Hi everyone, I really need your help with a KPI calculation issue I’m struggling with in Excel/Power Query.

I work in healthcare claims operations, and every day we receive batches of reimbursement requests. Each batch has two key dates:

Closing_Date → when the batch is finalized

Payment_Date → when the batch is actually paid

I need to calculate our monthly KPI based on how many batches were paid on time vs delayed, where “on time” means the payment was done within 1 working day after the closing date.

The problem:

If I simply subtract the dates:

Payment_Date – Closing_Date

It counts calendar days, including weekends. So for example:

Closing_Date = Thursday

Payment_Date = Sunday

The raw difference = 3 days → which gets classified as Delayed, even though this is actually On Time, because Friday/Saturday are non-working days.

What I tried:

I attempted to calculate working days using Power Query with custom M formulas, but the logic becomes complicated and doesn’t always return accurate results. I also tried using NETWORKDAYS in Excel, but my data model is connected to Power Query, and I prefer to keep the entire logic inside PQ if possible.

What I actually need:

✔ A reliable way (Excel or Power Query) to calculate working days difference between Closing_Date and Payment_Date ✔ Excluding weekends (Friday + Saturday) ✔ Optionally excluding public holidays in the future ✔ A way to categorize results into:

On Time (<= 1 working day)

Delayed (> 1 working day)

Data example:

Closing_Date Payment_Date Expected Working Day Difference

2025-08-14 (Thu) 2025-08-17 (Sun) 2 working days (Thu + Sun) 2025-08-19 (Tue) 2025-08-20 (Wed) 1 working day

Extra constraints:

The dataset is large (thousands of rows monthly)

Needs to work inside Power Query OR an external Excel formula

Must be reliable for KPI reporting


Question: 👉 What is the most accurate and efficient way to calculate working days only between two dates in Power Query (or Excel if necessary)? 👉 Any best practice for weekend/holiday logic or performance tips?

Thanks in advance — any help is appreciated!


r/ExcelPowerQuery • • Sep 25 '25

connecting powerquery to sharepoint

Post image
3 Upvotes

I had a file where my setup was combining and loading several files from a network folder into one table in Excel. well, my silly company took our network folder away and put us on sharepoint. i'm struggling on getting power query to connect to a sharepoint SUBFOLDER. i'm able to connect to the main sharepoint directory, but the problem is that there are way too many files and folders in this sharepoint location. it won't load them all, and i can't get to the subfolder i want. whenever i try to type in the subfolder location directly (i.e. https://sharepoint.com/sites/BlahBlah/Shared Documents/etc), i get the attached error.

anyone else find a solution to this issue or know what i'm doing wrong?


r/ExcelPowerQuery • • Sep 16 '25

Power Query Table Question

3 Upvotes

I’m working on an Excel table where: • Columns 1–5 are populated by a query I created. • Columns 6–10 are populated manually.

The issue is that when new data gets added to the query’s source, Excel only creates a new row for columns 1–5. This causes my manually entered data in columns 6–10 to get out of alignment with the query data, since it doesn’t “move down” with the new rows.

Is there a way to make sure the manual data stays linked to the corresponding query data, so that everything stays aligned when new rows are added?


r/ExcelPowerQuery • • Aug 14 '25

Lock Worksheet Editing

3 Upvotes

Hi, good day. I am having a small problem with worksheet lock. basically: 1: I have a raw data worksheet, where people can enter their data into. 2: that data is imported into Query, made the data transformation I wanted. 3: That query exported the data into another worksheet as a table.

somewhere down the line, people will edit directly into the query exported table instead of the raw data file that they are supposed to enter. So I want to lock it with protect sheet fuction.

My problem is when I worksheet is protected, I cant refresh the result worksheet anymore to add new data from the raw data sheet. Is there anyway I can do it? I am still trying but couldn't figure it out.

Thank you in advance.


r/ExcelPowerQuery • • Aug 13 '25

Specific data from rows to columns

3 Upvotes

Hi,

I have this big file loaded into Power query. It's item related.

There are mostly a few rows for each item as you can see on the print screen under 'CURRENT'

My goal is to change this in power query [since it's already loaded in PQ to perform other additional changes] to achieve the layout as displayed under 'DESIRED'.

Additional info,

-Same Item can have one or more rows [mostly <6]

-COL2 can be empty

-Only the COL2 with values are wanted in it's own column. But that's not mandatory, empty column from empty field is also okay

If it helps to achieve this, I may create Nth columns on forehand to be filled with the COL2 value, that's no problem.

Any idea or advice that may help me to achieve this?


r/ExcelPowerQuery • • Jul 19 '25

“Is Latest” tag help?

3 Upvotes

Having trouble with a project of mine. I have a table that imports data multiple times a day. A lot of the time, the rows will have identical data to multiple other rows. I’ve been trying to create a column that flags a row with a 1 if the values in a row are identical to that of another row to show that this row is the latest one imported. That way I don’t need to see multiple rows of the same thing on my PowerBi dashboard.

Any advice? I’ve tried grouping the columns and created a MaxDate column to flag a 1 if all values in a row match another row with identical values. I have a “created on” column to compare against but every single row is flagging with a 1.

Any help is appreciated!


r/ExcelPowerQuery • • Jul 18 '25

Starting point-learning powerquery

3 Upvotes

What's a great starting place or course for picking up powerquery from scratch? Im an 'advanced' Excel user (E.g. Create and manipulate pivot tables easily, create dashboards from scratch, datavalidation, lookup, dont use a mouse etc.), and have watched a few YouTube videos on PQ, but I'm just not at a point where I could apply what ive seen yet. Any course recommendations would be gladly appreciated. Many thanks


r/ExcelPowerQuery • • May 20 '25

Unstacking Help

Post image
3 Upvotes

Hi All,

Looking for some help unstacking the attached data that was export from an estimating program with division headers and subtotals underneath the subdivision aggregate items all in the same column. The headers should be associated with the Hier4Level columns in the adjacent columns. I did my best to indent the subdivisions in the image to show hierarchy. There are also some comments sprinkled underneath some items in the same column that I think should be in their own "comment" column only for those particular items.

Any help is appreciated!


r/ExcelPowerQuery • • Apr 04 '25

Create missing months

3 Upvotes

I would like your help in this matter.

I have a table which contains all the SKUs being produced by a company. Each row has a date, there is one row per sku per month so ideally an sku being produced the whole year has 12 rows in the year.

There are some SKUs that are produced only some months of the year, so for example if it is only produced in January, June and September I would only have 3 rows of data.

I want a way for power query to help me fill the missing months as per costing the cost of sales in the months without production would be the last production cost. So I want to create 4 rows for feb, mar, apr and may that are exactly the same as January. That for all SKUs and all months without production.

Does anyone know a way of doing this?