Forum Discussion
anupambit1797
Mar 04, 2025Iron Contributor
Power Query Combine Worksheet
Dear Experts, I have many sheets(>10) sharing only 2 here as an example. Each sheet has a data summary in the end as below, and I want to merge all the sheets into a Single one w...
- Mar 05, 2025
Tried with your files and experienced no issues. But you don't give us the query you created. I assume it's the standard Files From Folder route you took. Creating a parameter, a sample file, a function etc. Did that and all rows were included in the combined table, so that I could filter only the eight row headers (i.e. not the time stamps. But perhaps when you combine all files (more than 10, you say), perhaps you can't see the eight relevant ones in the filter.
Better to skip the fully automatic From Folder process. Try this instead:
Connect to a Folder as usual, filter only the files you need and then DO NOT press the combine button in the Content column! Remove all columns except for Content and Name. Now add a custom column as follows.
= Table.LastN ( Excel.Workbook([Content], true, true) {[Item="Sheet1",Kind="Sheet"]}[Data], 8 )
Reading from the inside out, this will extract the data from Sheet1 from the binary content (with headers promoted) and select the last 8 rows. Now remove the Content column and Expand the Custom column. The result is one table with the last 8 rows of each table.
Riny_van_Eekelen
Mar 06, 2025Platinum Contributor
Now I understand what happened. You set the data type for the TIME_STAMP column to datetime. That errors out all rows that do not contain valid date/time stamps in that column. These errors occur on your statistics rows which display blanks when you load the table to Excel. See picture below.
So, if you want to go with only UI clicks, remove the rows with date/times first. Then set the data types where the TIME_STAMP column now only contains texts. Obviously, you would rename that column at this stage.
But why not learn how to tweak the code as explained earlier. It will be a lot cleaner that way.