#"Added Custom" = Table.AddColumn(#"Previous Step", "Query Name", each "MyQueryName")
Hi,In the Advanced PQ Editor you'd add a line such as this:
where the new column's name will be "Query Name" and all rows will contain the literal MyQueryName.Code:#"Added Custom" = Table.AddColumn(#"Previous Step", "Query Name", each "MyQueryName")
In the GUI (not Advanced Editor) you'd add a Custom Column like:
View attachment 80226
Do that with all the queries you want, then when it comes to merging or appending you'll have one column containing the query source.
I can't do anything with your attachment which is blank because all the queries don't have access to 'C:\Users\pks2\OneDrive - Reckitt\Desktop\Others\Misc\Append\April2022.xlsx'
Ok then please suggest me to input our own text in append queryIn the attached file called Sample File_appendalong with nameFiles I have manually added a column to each of your queries (as I suggested in msg#3). I have kept the name of your folder so with a bit of luck it should run without adjustment.
This will be hard work because you'll have to add queries for every file you want to process and alter the Append1 query each time your data source file names change.
It should be easier for you to use the file called Sample File_appendalong with nameFolder which will look at all the excel files in your folder C:\Users\pks2\OneDrive - Reckitt\Desktop\Others\Misc\Append\ . This means that you should NOT save this workbook into the same folder, but somewhere else. When refreshing the table in this workbook it will look for all Excel files in your folder, so you should only have the files you want to extract data from in that folder before you refresh. With luck, it too will run out of the box.