r/ExcelPowerQuery • • Feb 28 '25

Get Data After

1 Upvotes

I have files that I want to combine and use together. That part I got down. However, the data I need is after a ridiculous amount of useless information and always starts after the cell that says “Table View”. Is there a way to set it up to grab the data after that?

TIA


r/ExcelPowerQuery • • Feb 27 '25

Date.EndOfYear returning first of the following year

1 Upvotes

I'm attempting to add a custom column to a table. The documentation, Date.EndOfYear - PowerQuery M | Microsoft Learn, says that:

Date.EndOfYear(#datetime(2011, 5, 14, 17, 0, 0))

Should output #datetime(2011, 12, 31, 23, 59, 59.9999999).

Instead I get #datetime(2012, 01, 01, 12, 00, 00).

Does anyone have any information on getting the expected result per the documentation?

EDIT: I forgot to add an actual question, so I added one.


r/ExcelPowerQuery • • Feb 26 '25

Sort Columns from toggle-able website?

1 Upvotes

I am trying to import columns from the website below. It brings in every possible combination of toggles and drop down from the website but the problem is that they are not marked in any way and the rows are also not sorted in a predictable manner by toggle. Im wondering if there is any way to change the code to sort rows by a predictable toggle order (pg,sg,sf,pf,c) or any way to mark the toggle they come from? https://www.fantasypros.com/nba/defense-vs-position.php


r/ExcelPowerQuery • • Feb 21 '25

Dumb Question Day

1 Upvotes

Howdy, very new to this space. Basically have ok pc skills but love data. Small business man looking to piece a puzzle together Working backwards I want an attractive dashboards with relevant data showing our KPI and important metrics. All the data I have is basic and needs exported daily or weekly, it also needs additional columns and maths done. Can this be automated with power query


r/ExcelPowerQuery • • Feb 18 '25

Column Add Formula Error

1 Upvotes

I am new to Power Query. Can someone explain why this formula is not working?

=if(isblank([Report]), Date.ToText([Report Entry], "MMMM-yyyy"), Text.BeforeDelimiter([Report], " "))

I am trying to get the cell to return the date January 2025 from one of 2 cells. The first cell has this data "January 2025 - $500.00", and sometimes that cell is blank. So when a blank cell appears I want it to pull the date, in the "January 2025" format, from the Report Entry cell instead. That date is currently in the date format of m/d/yyyy, example - "1/4/2025".


r/ExcelPowerQuery • • Feb 15 '25

Trying to connect MS form responses excel to a macro

1 Upvotes

Hello guys, thanks for the help in advance. I have a macro which connects to the Form responses excel saved in a teams channel documents library. I have used power query to refresh the data so we don't have to copy paste from the form responses to the macro. Is there a way that the macro refreshes (when I click refresh) with new responses without me going back to the OG excel and opening it to sync the latest updates ? It was working for last 1.8 years but suddenly Microsoft released an update and now I need to open the original excel so that it updates first and then the person running the macro updates their query to get the latest responses data.


r/ExcelPowerQuery • • Feb 12 '25

Capture value from cell as a variable

1 Upvotes

Hello,

I'm new to Power Query and have been trying to find an answer to do this for the last few days, haven't gotten any answers.

I have selected the data I need to query, and most of what I've been trying to accomplish works perfectly. I do need to create a couple custom columns later in my query with information found in a number of cells.

That is what I am trying to find out how to accomplish. When I create a custom column, how can I refer to a specific cell? I know it isn't possible in the sense of Excel, but is it possible?


r/ExcelPowerQuery • • Feb 10 '25

Add new data to filter in Power Query

1 Upvotes

I have a filter to remove all the non desired values, but when i add new data i don't know if any of those are needed or not.

I wanted to do something like the pivot table option "Include new items in manual filter"

Does anybody knows how to do this?


r/ExcelPowerQuery • • Feb 07 '25

I have daily report that I want to append to existing query table already processed. How to make the process faster?

1 Upvotes

I have hundreds of files sitting in the same folder that I need to append in one table.
In this folder, there will be a new daily report added on a daily basis.
I want append them to one query table however since the previous files are already transformed and appended, I want to avoid reloading and reprocessing it.

I found the way only transforming the latest file but not able to find a way to append it to already transformed and existing table.

Please help!


r/ExcelPowerQuery • • Feb 07 '25

Creating a table to count records by month

1 Upvotes

Hello everyone,

I've been struggling to self-serve in finding a way to take an existing data set and count the records for each month of the year. Eventually I'd want to branch this out so I can calculate the average number of records as well. I tried the group by method but that seems to count for each day so I feel like I am missing something in the steps I'm taking.

Is this something someone could help assist with? Or at least point me in a more reliable direction where I can self-serve? Any help would be greatly appreciated!


r/ExcelPowerQuery • • Jan 31 '25

Average across a folder using Power Query

1 Upvotes

Hi All, thank you in Advance.

I am trying to pull data from a folder called DK SS. All headings in each sheet are exactly the same. My "Main" workbook has a sheet called "Today" which has todays players. I want to power query a new Sheet called "Points" based on the Players in "Today" from the folder "DK SS". In the Folder "DK SS" are sheets by date. example -"01-02". I want to average all the sheets for each player. Thank you again.


r/ExcelPowerQuery • • Jan 29 '25

What needs to be true on the IT/infrastructure side, for users to be able to use Power Query to get data from a SQL Server db?

1 Upvotes

I'm in IT. I've been out of the dba (SQL Server Admin) role for a long time and the organization I work in doesn't have anyone dedicated to that role. Recently, I perfected a complicated query that gives a particular department all the info they need to produce an important report. I'd like to be able to embed that query in an Excel spreadsheet so they can just open the .xlsx and voila`. I can create an ODBC (the connection type with which I am most familiar) "source" and use it to get the data through PQ, but that's not optimal since that ODBC object would have to be installed on a dozen machines and even then access would be limited to those machines. So far I cannot get the Get Data --> From Database --> From SQL Server Database connection to work - even with my SQL Administrator credentials or a special user set up just for this purpose. When I follow that path to the dialog titled "SQL Server database" and fill in the Server, Database, and SQL statement fields, I get an "Unable to Connect" dialog, with the details "Loading assembly file 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[redacted]' failed for data source type 'SQL'" There's an actual hex "token" that I've redacted.

My spidey sense tells me there's something on the AD or SQL Server side that isn't set up pcorrectly, I just don't know what that would be. In this exercise we're trying to connect to Microsoft SQL Server 2016 (SP3-GDR) (KB5046063) - 13.0.6450.1 (X64) Sep 27 2024 19:17:51 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: ).

All suggestions will be greatly appreciated!


r/ExcelPowerQuery • • Jan 29 '25

working on this for a long time - PQ

1 Upvotes

Hi all,

I have 40 sets of data each set has 2 files. I want to combine those 2 files of each set into single file.

For example, files name be like

Sales - 1

Sales - 2 Which is basically a single set. Now I want to combine Sales 1 and sales 2 to a single file. And pls note that each file has different sheet names.

How I manually do is open each file and copy paste all the files into single file. Which takes around 30-40 mins

Thanks in advance! 😊


r/ExcelPowerQuery • • Jan 29 '25

Automate finding Discrepancies between spreadsheets // Csvs?

1 Upvotes

Hello everyone,

I am hoping this is the right sub for this question. I've got multiple spreadsheets compiling devices, os, ips and some other data. What I am trying to do is combine these spreadsheets and present them as one by merging the data so that it is all the same.

The issues that arise is some of the spreadsheets don't have the same data which I want to make sure I preserve so we know what data source is missing data or which data is different.

I've been able to do this with power query by using it to find discrepancies an filter it down to accurate information. The only problem is that I'd like to make this repeatable which I wasn't sure if power query templates was the right choice for this or if I should look at another option.

What I am looking for is potential suggestions as far as if power query is the correct way to go or if there is another way to process this information effectively.


r/ExcelPowerQuery • • Jan 28 '25

Create a date list from unique id

1 Upvotes

Hi. I am creating a query that consolidates reports in a folder. Each report is a living report, meaning new items could be added or potentially roll off. I am trying to create a field in my query that pulls the date using the file source that has date the report was added to the folder.

To summarize, I grouped the unique id's and adjusted the table.group to include the text.combine(list.distinct([column name] into a line feed list for each selected column. I have one colum "date" that I can't seem to combine and get a distinct, even changing the type from text to number. I still get an error

Any suggestions?


r/ExcelPowerQuery • • Jan 23 '25

Ingest HTML from SharePoint folder

1 Upvotes

I've got a .HTML file in a sharepoint document library, the HTML file contains a table. It is automatically generated elsewhere and I've exhausted my options for changing the format upstream.

In powerquery if I connect to a local version of the file it behaves as expected, literally the same file just through onedrive rather than through a sharepoint connection, powrequery presents me with the load navigator where I can select 'document' or 'Table' and pull it into the transformation screen as you'd expect.

If I reference the same file through 'sharepoint folder' type query I get stuck. First I have to authorise my connection twice, once for the site and a second time for the file (i think), after the second authentication I am asked to classify the data as public/organisational/??? or tick 'don't classify', once I've done that I end up with error 'Expression.Error: Access to the resource is forbidden'.

Other connections to the same sharepoint folder for files .CSV / .TXT / .XLSX all work fine / as expected, it is just how the query editor is handling the connection to this HTML file.

Any thoughts on how I get around this?


r/ExcelPowerQuery • • Jan 23 '25

Datasource file or folder not found- single user only

1 Upvotes

I have a query that is designed to combine 2 files and be back the information for a specific ID. It works fine for the users who use it, except for one individual. They are prompted with an error "[DataSource Not Found] file or folder. We couldn't find the folder...", in our local share drive folder.

I confirmed the source is mapped correctly, and when I click the folder from the source settings in the query, it connects until I check the other query in the editor, and then it loops.

How can I get this to work for all users who need to use it and not just some?

Thank you .

Edit: I was able to fix it. Using the 'Window + R', to test the network link to find the network path folder location, I was able to capture the correct path. Then, I replaced the file location from the advanced editor with the network file path.


r/ExcelPowerQuery • • Jan 22 '25

Power query

1 Upvotes

Hi PQ community.

Looking for some new ideas for a case I cant find a solution not even with GPT.

PQ loaded in PBI

Query 1 headers: HR Id, Contract code, RecordedDate.

For each HR Id have the date (RecordedDate) for an HR event (Contract code).

6 codes: STSEC - First day active is secondment, ENDSEC - last day active in secondment, STPERM - first day active in Permanent position, ENDPERM - last day active in Active Permanent position, STLEAVE - first day in Inactive (leave), RETLEAVE - first day back from leave.

Query 2. HR Id, RecordedDate. Each HR Id is assigned all working days between Dec 1, 2024 and Dec 31, 2025. Aprox 22K rows.

Scope: Query 2 gets a new column "Remove", value true if the HR Id empl was not active.

Example : STSEC Dec 15, 2024// STLEAVE Jan 15,2025 // RETLEAVE Feb 15, 2025 // ENDSEC Apr 15, 2025// STPERM Jun 15,2025 // ENDPERM Nov 15, 2025. Column Remove : true for Recorded dates on rows Dec 1, 2025 - Dec 14, 2024 // Jan 16,2025 - Feb 15,2025 // Apr 16, 2025 - Jun 14, 2025 // Nov 15, 2025 - Dec 31, 2025.

Conditions:

If last status code before Dec 31, 2025 is a STSEC, STPERM all following dates false.

If ENDSEC, ENDPERM, STLEAVE all following dates true + STLEAVE date.

If first code after Dec 1, 2024: STSEC, STPERM, STLEAVE all dates prior gets true.

If first code ENDSEC, ENDPERM, ENDLEAVE all dates from Dec 1, 2024 to inclusively the mentioned code dates gets the value true in Remove new column.

In other words I want to remove all the inactive dates from the calendar for all employees.

Any help/idea is appreciated. Cheers


r/ExcelPowerQuery • • Jan 17 '25

How to get KPIs for several different regions.

1 Upvotes

I made something in Excel and want to know how to do it in power BI but first I need to do the following in power query: I have a sheet with all absences and I need to imoprt the manager for each row from a list of lookup values. Then I have 8 sheets, each with employee lists where I also imoprt through vlookup the managers. Using a countif function I can ascertain how many employees each manager had for each period and then compare that with the numbers on the first sheet with the absences to get absenteism per manager per quarter and then I can drill down to location and person.

I want a grid with managers in the rows and columns being period and each cell showing the calculation of absence/hours.


r/ExcelPowerQuery • • Jan 16 '25

Création colonne si elle n’existe pas

1 Upvotes

Bonjour,

Comment faire pour que la création d'une colonne se face si elle n’existe pas.
Exemple après avoir fait pivoter un tableau avec la commande suite :

= Table.Pivot(#"Colonnes supprimées", List.Distinct(#"Colonnes supprimées"[TYPE_ENCAISSEMENT]), "TYPE_ENCAISSEMENT", "MONTANT", List.Sum)

regarde si la colonne Espèce est présente et la créer si elle n’existe pas


r/ExcelPowerQuery • • Jan 09 '25

Question about utilizing Power Query

1 Upvotes

Hi friends, I am so sorry for the headache I'm about to list out but I cannot find the answer I need anywhere so I'm here on Reddit.

Here's what's happening : my company has developed a tool to track development issues (bugs, security issues, patching problems, etc) company wide. The Exec teams are using this as their source of truth. The issue though is that it doesn't give records of what's been completed, just total #'s change and items fall off when an issue has been resolved. My immediate leadership team is looking for a way to track items in a meaningful way, and be able to show that our developers have been fixing things, and add notes so that we can say 'Team A is working on bug 27' or what have you.

I can export from this tool a csv file which is updated daily with the items on it, but if an item has been closed out, it's just not on the spreadsheet any more. Which leads to a ton of extra work to generate a master list showing what's been done, what's in progress, what is still in the queue and which team it's related too, when I get new issues daily, and others fall off and I have to manually go through and mark issues as 'Closed'.

I've been given various tools to try to use and now I'm here on Power QUery as the hopeful answer to my quest. Here is what I need to accomplish, preferrably in minutes rather than hours :

  • Need to append data into the master list daily from an exported csv sheet for new records

  • need to have old data updated (Some fields update like SLA countdown for example) from the new csv sheet - there is a Unique Identifier to each row that can be used.

  • and then I need a way for records that are not in the new csv sheet to be marked as closed. I'd rather it be automatically when I upload the sheet, but if I have to do it twice or something similar, that'll work.

I am praying that I may have finally found my answer with Power Query, but I am definitely not holding my breath. If there is a different, preferrably free, tool I can use to do this with, please guide me. lol.


r/ExcelPowerQuery • • Jan 08 '25

Bulk Replace in Power Query: #powerquerytips #powerquery #excel #bulkreplace

Thumbnail
youtu.be
1 Upvotes

In this video, we'll dive into one of the most powerful features of Power Query: bulk replacing values. Whether you're cleaning data, standardizing entries, or just making your datasets more manageable, bulk replace is a game-changer


r/ExcelPowerQuery • • Dec 15 '24

Group data based on order info

1 Upvotes

I have a data set with one line for each product ordered on a sales order. For example, if only one item was ordered on Order #12345, there is one line in the data set. If 10 items were ordered on Order #12346, there are 10 lines in the data set.

I am trying to use Power Query to "roll up" or summarize the orders based on whether or not the order includes my top-seller which I've called "Test 1" in this example. For any order that includes Test 1 as at least one of the order choices, I want to designate that Order # as a "Test 1 order" (regardless of how many other order types are on that order). Similarly, if an order does not have a Test 1 order choice, it should be considered a "non-Test 1 order".

I am ultimately trying to see what is my average order value for order choices that include a Test 1 versus those that do not. I was thinking Group By in PQ would be the solution here but having trouble getting the desired output.


r/ExcelPowerQuery • • Dec 03 '24

Custom column. Result being closest value in a list.

1 Upvotes

Hi,

Any advice on this gratefully received. I'm trying to figure out a way of creating a column that will find the closest match in a table per row.

So for example if the reference table had Pacific Atlantic Mediterranean

And the row description cell said "June 2024 Pacific excursion" it would recognise the Pacific option as the closest match and have this as the result in the custom column for the particular row.

Is this possible?