r/ExcelPowerQuery • u/n0145421 • Mar 26 '26
r/ExcelPowerQuery • u/No-Drawing211 • Feb 12 '26
ower Query — How to replace an existing input table without breaking structured references?
I have an Excel model where the input tab contains a table (as opposed to a range) that the rest of the model references using structured references.
Currently, my process is:
Copy raw data from an input file
Paste it into the input tab table
Manually clean/adjust the data either before or after pasting
I’d like to replace this manual process with Power Query so that:
The raw file is cleaned in PQ
The cleansed data loads directly into the model
However, I’m running into a problem:
Power Query won’t load directly “on top of” an existing Excel table object. If I delete/replace the existing input table with the PQ-loaded table, Excel rewrites the structured references and breaks the model.
The cleaned data has identical headers and structure — I just need to replace the existing input table’s data source with the Power Query output without severing the structured references used elsewhere in the model.
What is the correct way to:
Replace an existing input table with a Power Query version
Preserve the table name
Avoid breaking structured references in the model
Appreciate any advice on best practice for this setup.
r/ExcelPowerQuery • u/Different_Bobcat_903 • Jan 27 '26
Having trouble creating a report
I’m very new to power query, and im trying to change my excel report into power query to automate it a bit more.I work in credit control and am trying to build a report to keep track of outstanding invoices. I have an independent report I download into excel which gives me account number, supplier name, invoice number, transaction date, due date, balance, and then a column called open which while not useful sits on the report.
I built an excel worksheet where I post that data into column a-g and I then do
H - days overdue - today formula - due date to get days overdue
I - aging - long if statement that comes down to if the awnser of H is below zero return current, 30 days or over month one, 60 days and over month two etc
J - approved - it’s a data validation list of common causes of issues, a quick glance like approved pending query and some conditional formatting which highlights it depending on severity
K - manual notes column to type notes
L - last actioned date, manual
M - long IF that has a look at J L and the due date and tells me when to follow up. If I say it’s approved for payment it will be end of month if I need to Chase it will be three days, that type of thing.
I was quite happy with this because it automates a lot of what I do but I had to keep creating a blank template copying the new export then doing a bunch of formulae to bring the data from my report. Last time I put the lookup to the account number instead of the invoice number and did not realise until it was too late so scrambled and lost a lot of my work.
I want to make a power query where I can paste my a-g data into the spreadsheet. It will give me a list of them removing ones from my working sheet no longer on the report. It will add or keep my current notes to the ones I have made notes for and add the new items to the report blank.
The problem I’m having is for the first attempt creating two tables is refreshing the a-g import but refreshing my notes back to what they were first time I put them on, I only have a list of invoice number and my notes on that page so it’s a bit difficult to work from I need to be looking at the full import data so need it on the same page as where I type my notes.
started again made a new table adding the notes above outside the power query but same excel table. It worked but refreshing the data scrambled the notes. I could make two work sheets a-g for the import my notes on another I-m then have a final output table but I need the data on a-g on the same page as my notes so I can make the notes accurately.
Not really sure how to proceed or if it’s possible so does anyone have any ideas? It won’t be the end of the world if I have to just scrap the idea and go back to excel but being able to refresh everything with a button press would save a lot of time.
r/ExcelPowerQuery • u/FuzzyIon • Jan 23 '26
PQ changes Excels Time format to Date/Time, how can I automate changing it back to Time for each additional source file I add?
I find this feature so aggravating, if Excel has a cell formatted to Time why on earth would PQ convert it to Date/Time??
I know how to manually change the 5 columns with Date/Time format back to Time but I dont want to have to do this weekly everytime I add a new source file.
How do I automate this change?
r/ExcelPowerQuery • u/WhatsBrownAndSticky • Nov 30 '25
Adding file name to power query get data for 900+ docs
reddit.comr/ExcelPowerQuery • u/Jig_nesh • Nov 28 '25
I'm here for honest feedback—please don't be like ChatGPT giving me compliments for drinking water... haha
Hey everyone,
So I'm in my 4th year of college, and something happened two days ago that got me thinking.
I was chatting with my senior who's working now, and man, I had no idea how much people use Excel at work. Like, he uses it for literally everything—even designing websites! I was pretty surprised.
On my way back to my room, I kept thinking about this. So many people use Excel every day—corporate folks, small businesses, everyone. I started googling around and found these tools like Formula Bot where you describe what you need and it gives you the formula. Pretty cool, but you still have to manually apply it to your sheet.
Then I thought—what if there was something where you just upload your Excel file, type what you want done, and get the updated file back? Like, no copying formulas or doing manual work.
r/ExcelPowerQuery • u/annadownya • Nov 28 '25
Bypassing windows credentials for SharePoint list access
I am creating several PQs to run comparison reports for us. Basically its taking our SharePoint list of the procedures we review and comparing them to an excel file from another SP of all the procedures for the company to find discrepancies like missing items and mismatched owners or other data. Typical stuff. What i built runs pretty well and I'm happy so far. One thing I'd like to try and fix is the credentials pop up. Is there a way to set it up so that whomever runs it will have it default to their windows credentials for verification of SP access so I don't have to include instructions for everyone? Most people are fine but I'd like to make it as idiot proof as possible. I have macros that refresh the queries to run the report for them so I could incorporate that way if it's an option. The couple ideas I saw and tried from Google haven't really worked.
r/ExcelPowerQuery • u/AcanthaceaeFun2268 • Nov 27 '25
besoin d'aide pour des API
Bonjour, ça fait plusieurs semaine que j'essaie de faire marcher correctement une requête excel query et je n'y arrive pas, pour expliquer grossièrement : j'ai une liste de siret (environ 130), a partir de ces siret je fait un appel a l'api de l'insee (https://portail-api.insee.fr/) pour récupérer la date d'ouverture, voici ma fonction :
GetDataForSiret = (siret as text) as table =>
let
url = "https://api.insee.fr/api-sirene/3.11/siret/" & siret,
headers = [
#"accept" = "application/json",
#"X-INSEE-Api-Key-Integration" = APIKey
],
response = try Json.Document(Web.Contents(url, [Headers = headers])) otherwise null,
etablissement = try response[etablissement] otherwise null,
periodes = if etablissement <> null and Record.HasFields(etablissement, "periodesEtablissement")
then etablissement[periodesEtablissement]
else null,
resultTable = if periodes <> null and List.Count(periodes) > 0
then Table.FromList(periodes, Splitter.SplitByNothing(), {"Périodes"})
else #table({"Périodes"}, {})
in
if resultTable = null
then #table({"Périodes"}, {})
else Table.ExpandRecordColumn(resultTable, "Périodes", {"dateDebut"}),
la fonction marche correctement, je récupère bien mes infos, le problème c'est que je fait beaucoup trop de requête (entre 150 et 180 pour 30 lignes) et les api de l'insee sont limité a 30/minutes,
j'ai tester plein de truc, j'ai commencer par désactiver les donnés en arrière plan, j'ai essayer de rajouter un timer dans la fonction, j'ai changer plein de fois la fonction en espérant que ça change quelque chose, mais aucun résultat,
le dernier changement que j'ai fait c'est de séparer ma requête en référence de 30 lignes, mais ça ne change rien, je fait toujours trop de requête, je n'arrive a comprendre pourquoi
quelqu'un a eu le même problème ? ou bien une idée ? ce reddit est mon dernier espoir...
r/ExcelPowerQuery • u/tututu-draw • Nov 26 '25
Power query need help
I need help if anyone has a solution please Currently I have two columns in my Excel file that I reworked with Power Query. This file contains thousands of lines. I will need that each time a cell in the first column = a specific word, then this transposes the data Here is an example of what I currently have: Column 1 column 2 A specific word. 1111 Another test Other1 test A specific word. 222222 Other etc.
I want the result to be this: A specific word other other1 1111 Test Test A specific word other other1 22222 Test Test
r/ExcelPowerQuery • u/Fun_Coast_3429 • Nov 20 '25
table transformation from verticle to horizontal
r/ExcelPowerQuery • u/Unique_Suggestion291 • Nov 18 '25
Salesforce to PowerQuery
For the love of god, what is a workaround to export more than 2000 rows from an Online Salesforce report into PowerQuery?
r/ExcelPowerQuery • u/Signal_Trainer_7518 • Nov 12 '25
need help to clean a database
Hello, i'm currently doing an historical research and recovered a huge and messy database. I have to clean it otherwise it's useless. My database is a list of people, compiled by cross-referencing archives. For each person's attestation, a new row was created (instead of adding a column that mentions the second archive reference). Therefore, I have duplicates that I cannot delete without risking data loss. I also have a column of dates containing series and intervals. I would like to be able to merge the rows where the first and last name are identical and convert all the dates into series. Does anyone have any idea how to do this and/or how to useMy database is a list of people, compiled by cross-referencing archives. For each person's attestation, a new row was created (instead of adding a column that mentions the second archive reference). Therefore, I have duplicates that I cannot delete without risking data loss. I also have a column of dates containing series and intervals. I would like to be able to merge the rows where the first and last name are identical and convert all the dates into series. Does anyone have any idea how to do this and/or how to use excel (i've try PowerQuery but it's not working so i'm using it wrong) or OpenRefine?
Thank you
r/ExcelPowerQuery • u/Queasy_Sherbert_1899 • Oct 30 '25
Tips to improve this query I am open to advice
let Origin = SharePoint.Files("https://fesa1.sharepoint.com/sites/BasesDataVoice", [ApiVersion = 15]), FilteredRows = Table.SelectRows(Source, each ([Folder Path] = "https://fesa1.sharepoint.com/sites/BasesDataVoice/Documentos shared/Call Detail Report (ALL)/") and ([Name] = "10- Call Detail Report (ALL) Oct.xlsx")), FiledHiddenFiles = Table.SelectRows(FilteredRows, each [Attributes]?[Hidden]? <> true), InvokeFunction = Table.AddColumn(FilteredFiles, "Transform file (2)", each #"Transform file (2)"([Content])), RenamedColumns = Table.RenameColumns(InvokeFunction, {"Name", "Source.Name"}), RemovedColumns = Table.SelectColumns(RenamedColumns, {"Source.Name", "Transform file (2)"}), ExpandedColumn = Table.ExpandTableColumn(RemovedColumns, "Transform file (2)", Table.ColumnNames(#"Transform file (2)"(#"Example file (2)"))), ChangedType = Table.TransformColumnTypes(ExpandedColumn, {{"Source.Name", type text}, {"TransactionId", Int64.Type}, {"Call Entry", type datetime}, {"Macroprocess", type text}, {"Campaign", type text}, {"Call Type", Int64.Type}, {"Phone", type text}, {"IVR Time", Int64.Type}, {"Queue Time", Int64.Type}, {"Call Time (sec)", Int64.Type}, {"Call Time", type text}, {"notes", Int64.Type}, {"User Password", type text}, {"Login", type text}, {"Typing", type text}, {"Subtyping", type text}, {"Class", type any}, {"Comment", type text}, {"DVID", type number}, {"Phone Type", type text}, {"HANG UP", type text}}, "es-MX"), NullACero = Table.TransformColumns(ChangedType, {{"IVR Time", each if _=null then 0 else _, Int64.Type}, {"Queue Time", each if _=null then 0 else _, Int64.Type}, {"Call Time (sec)", each if _=null then 0 else , Int64.Type}}), IniTalk = Table.AddColumn(NullsACero, "IniTalk", each [Call Entry] + #duration(0,0,0, [IVR Time] + [Time Row]), type datetime), FinTalk = Table.AddColumn(IniTalk, "FinTalk", each [IniTalk] + #duration(0,0,0, [#"Call Time (sec)"]), type datetime), DurTalkSeg = Table.AddColumn(FinTalk, "DurTalkSeg", each let ini = [IniTalk], finRaw = [FinTalk], fin = if finRaw < ini then finRaw + #duration(1,0,0,0) else finRaw in Number.From(Duration.TotalSeconds(fin - ini)), type number), PositiveFilter = Table.SelectRows(DurTalkSeg, each [DurTalkSeg] > 0), WorkDate = Table.AddColumn(FilterPositives, "WorkDate", each Date.From([IniTalk]), type date), StartInterval = Table.AddColumn(WorkDate, "StartInterval", each let dt = [IniTalk], h = Time.Hour(Time.From(dt)), m = Time.Minute(Time.From(dt)), mBucket = Number.RoundDown(m / 30) * 30, t = #time(h, mBucket, 0), d = Date.From(dt) in #datetime(Date.Year(d), Date.Month(d), Date.Day(d), Time.Hour(t), Time.Minute(t), 0), type datetime), IntervalEnd = Table.AddColumn(IntervaloStart, "IntervaloEnd", each [IntervaloStart] + #duration(0,0,30,0), type datetime), IntervalTxt = Table.AddColumn(IntervaloEnd, "IntervaloTxt", each Time.ToText(Time.From([IntervaloStart]), "HH:mm"), type text) in IntervaloTxt let Origen = SharePoint.Files("https://fesa1.sharepoint.com/sites/BasesDataVoice", [ApiVersion = 15]), FilasRows = Table.SelectRows(Origin, each ([Folder Path] = "https://fesa1.sharepoint.com/sites/BasesDataVoice/Documentos shared/Programming/") and ([Name] = "10- Programming Oct.xlsm")), FiledHiddenFilters = Table.SelectRows(FilteredRows, each [Attributes]?[Hidden]? <> true), InvokeFuncion = Table.AddColumn(FilteredFiles, "Transform file", each #"Transform file"([Content])), RenamedColumns = Table.RenameColumns(InvokeFunction, {"Name", "Source.Name"}), RemovedColumns = Table.SelectColumns(RenamedColumns, {"Source.Name", "Transform file"}), ExpandedColumn = Table.ExpandTableColumn(RemovedColumns, "Transform file", Table.ColumnNames(#"Transform File"(#"Example File"))), ChangedType = Table.TransformColumnTypes(ExpandedColumn,{{"Source.Name", type text}, {"Date", type date}, {"EmployeeNum", Int64.Type}, {"Name", type text}, {"Campaign", type text}, {"Login", type text}, {"Supervisor", type text}, {"Entry Date", type date}, {"Exit Date", type text}, {"In Schedule", type time}, {"Out Schedule", type time}, {"Operation Center", type text}, {"Group 2", type text}, {"Scheduled Day", Int64.Type}}), FilteredRows1 = Table.SelectRows(ChangedType, each ([Campaign] = "INBOUND")), GroupedRows = Table.Group(FilteredRows1, {"Date", "Operation Center", "Login"}, {{"In Schedule", each List.Min([In Schedule]), type nullable time}, {"Out Schedule", each List.Max([Out Schedule]), type nullable time}, {"JP", each List.Sum([Scheduled Day]), type nullable number}}), IniDT = Table.AddColumn(GroupRows, "IniDT", each #datetime(Date.Year([Date]), Date.Month([Date]), Date.Day([Date]), Time.Hour([In Schedule]), Time.Minute([In Schedule]), Time.Second([In Schedule])), type datetime), FinDT_raw = Table.AddColumn(IniDT, "FinDT_raw", each #datetime(Date.Year([Date]), Date.Month([Date]), Date.Day([Date]), Time.Hour([Out Time]), Time.Minute([Out Time]), Time.Second([Out Time])), type datetime), FinDT = Table.AddColumn(FinDT_raw, "FinDT", each if [FinDT_raw] < [IniDT] then [FinDT_raw] + #duration(1,0,0,0) else [FinDT_raw], type datetime), Remove_FinDT_raw = Table.RemoveColumns(FinDT, {"FinDT_raw"}), SecondDuration = Table.AddColumn(Remove_FinDT_raw, "SegDuration", each Number.From(Duration.TotalSeconds([FinDT]-[IniDT])), type number), DailyWindow = Table.Group(SegDuration, {"Login","Fecha"}, {{"StartDay", each List.Min([IniDT]), type datetime}, {"EndDay", each List.Max([FinDT]), type datetime}}) in DailyWindow let Tip = #"Typification", Vent = #"Scheduling", Tip_Types = Table.TransformColumnTypes(Tip, {{"Login", type text}, {"WorkDate", type date}, {"StartInterval", type datetime}}, "es-MX"), Merged = Table.NestedJoin(Tip_Types, {"Login","WorkDate"}, Vent, {"Login","Date"}, "v", JoinKind.Inner), Expanded = Table.ExpandTableColumn(Merged, "v", {"StartDay","EndDay"}, {"StartDay","EndDay"}), Filtering = Table.SelectRows(Expanded, each [StartInterval] >= [StartDay] and [StartInterval] < [EndDay]), ModifiedType = Table.TransformColumns(Filtered, { {"Typification", each if _ <> "UNTYPEFIED CONTACT" then "TYPEFIED CONTACT" else "UNTYPEFIED CONTACT", type text } }), #"Changed type" = Table.TransformColumnTypes(ModifiedTypification,{{"TxtInterval", type time}}), #"Grouped rows" = Table.Group(#"Type changed", {"WorkDate", "TxtInterval", "Login", "Typing"}, {{"Count", each Table.RowCount(), Int64.Type}, {"Call Time (sec)", each List.Sum([#"Call Time (sec)"]), type number}}) in #"Grouped Rows"
r/ExcelPowerQuery • u/Smooth_Beginning508 • Oct 30 '25
Using Power Query to pull data from multiple online excel workbooks when region in drop down list changes
I have created a dashboard that shows certain data points for regions in my city. I now want to create a dropdown for different regions that when I change them, it auto populates the same datapoints for each region below. Each region's data is saved in workbooks on my company's Sharepoint. I need help using power query to pull in each region's data to the master sheet when I change the submarket name in the dropdown. Can anyone help?!? FYI I am a Power Query beginner and am currently teaching it to myself...
r/ExcelPowerQuery • u/direstraits05 • Oct 22 '25
Power query novice needs advice
Hi champions Copilot has helped me get into the weeds of trying to get my data sorted. I've come to a screaming halt editing. Should I do some sort of course or just ask for tips here? Thanks for any help.
r/ExcelPowerQuery • u/Least_Ad_984 • Oct 21 '25
Automation
For those involved in estimation, is there a way to automate the process of comparing the quantities and prices from supplier quotations (pdf) with the Bill Of Materials data in an Excel sheet?
r/ExcelPowerQuery • u/AppropriatePool4703 • Sep 25 '25
Why SharePoint.Files() works but SharePoint.Contents() won't authenticate
Can I know why when I connect using SharePoint.Files(), there’s no credential issue, but once I switch to SharePoint.Contents(), it immediately shows the error “We couldn't authenticate with the credentials provided. Please try again.” even though I’m logging in the exact same way? Is there any solution to overcome this?
The reason I want to use SharePoint.Contents() is because it retrieves files much faster compared to SharePoint.Files(), where I need to apply filters to search for the file I want and that process takes too long.
r/ExcelPowerQuery • u/sudseclipse • Aug 06 '25
Keeping comments aligned to my Power Query table rows?
Hey all, I’m pulling a read-only SharePoint Excel file into Sheet1 via Power Query, then my team adds comments in columns next to it. Problem is, any refresh or filter shuffles the data and mis-aligns our notes.
Tried: • Manual columns next to the table (breaks on filter/refresh) • Mirroring with INDEX formulas (still row-based) • “Analyze in Excel” on Power BI (pivot only
I’ve got a 3-sheet + VBA trick that works, but feels overkill. Anyone know a simpler no-code way to keep comments tied to each record, even after refresh/filter/sort? Thanks!
r/ExcelPowerQuery • u/Ok_Advantage_3029 • Jul 20 '25
Getting Error when using the IN Operator
Running a power query in excel, receiving the following error;
DataSource.Error: ODBC: ERROR [42000] SQL compilation error: error line 8 at position 41 invalid identifier '"250815795"'
Details: DataSourceKind=Odbc DataSourcePath=dsn=SF_DNS_DWAAS_PROD OdbcErrors=[Table]
The power query is:
let
varWhereClause = Excel.CurrentWorkbook(){[Name="tblWhereClause"]}[Content]{0}[WhereClause],
Source = Odbc.Query("dsn=SF_DNS_DWAAS_PROD", "SELECT CUST_NAME AS Customer_Name, GRP_NBR AS Group_Number, MEMB_ID AS
Member_ID, MEMB_NM AS Member_Name, CLMT_ID AS Patient_ID
FROM YPR_PRD_UMR_CLAIMS_DB.FOUNDATION.VW_CLAIM_SERVICE_DETAIL
WHERE
" & varWhereClause & ""
)
in
Source
The variable varWhereClause is cast ([PRVD_IRS_NBR] as varchar(9)) in ("250815795","240795463")
r/ExcelPowerQuery • u/r10m12 • Jul 14 '25
New column as mmm-yy based on date column
I want to add a column with mmm-yy based on a normal date column so each row has the full date and the corresponding Month-Year.
Any advice how to achieve this?
r/ExcelPowerQuery • u/Theorist84 • Jul 02 '25
"Someone else is using the file" error message when saving
I have several queries producing tables in the same excel file where the source data is.
When I try to save the file: the "Someone else is using the file" error message pops up.
Any way to solve this error?
Thanks
r/ExcelPowerQuery • u/Autistic_Jimmy2251 • Jun 21 '25
Adding data to serial numbers in existing data?
I have a data set I want to pull into PQ.
Every time it encounters a specific serial number such xxx I need it to add 1.1.3 or if if finds zxz I need 6.2.4, etc.
Do I need to add this before trying it in PQ or can PQ handle this?
r/ExcelPowerQuery • u/Muitointediado123 • May 06 '25
Using a Analysis for Office (SAP) crosstab as source for Power Query
Hi, I use Analysis for Office (AFO) to extract data from SAP BW. I would like to whatever I extract I feed it to Power Query to continue the transformation of the data.
The problem is that I use it through "Get data from table", but every time that I refresh the AFO query, it overwrite the table and ruin the feed.
Anyone tried to do that? How can I feed the AfO report to power query eficiently.