Add Column with Table Name

RobertN

New Member
Joined
Jan 10, 2020
Messages
27
Office Version
  1. 365
Platform
  1. Windows
  2. Web
I am very new to Excel Power Query. I have created a simple query that aggregates data from all excel files in a specific folder. These files are specific to individual employees but there is no column with the employee's name. I can't tell which record belongs to which employee and I really don't want to add a "Name" column to the source tables. Is there an easy way to add a column that appends the source table name to each record (row)?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
The employee names are reflected in the file names (i.e., john.xlsx) and the name of the tables where the source data resides, but not in any cells in the table.
 
Upvote 0
sure,
so if you did From Folder hit Edit not Combine
then you'll see columns Content and Name and some more
select Content and Name then Remove Other Columns
Extract employee name via Transform tab (after delimiter/before delimiter or whatever)
Expand Content
Expand column Data (choose columns you want to use)

hope that help
 
Upvote 0
Thank you, Sandy. I am able to load the file name and additional file specific information like extension, date accessed, folder path, etc. However, that just produces a list of the files that exist in the folder, not the data in the workbook table. I need the employee name appended to each record (row) that was derived from their file/table. The file that John maintains is called John.xlsx, in this workbook there is a worksheet (tab named DATA) with a table named "John" with headings like Date, Time, Client, Units Sold, etc. (but no column with employees name). There are several other files that follow the same convention in the source folder. I have been able to successfully pull the individual employee data (referencing the DATA worksheets) and load into a table in excel, but I also need a column that adds the employee name to each row that was derived from their table (or file).
 
Upvote 0
Thank you so much, Sandy! That is exactly what I was looking for.
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top