Forum Discussion
How to add a new column with file source name
- 4 years ago
Hi Anonymous ,
1. If you are connecting to these excel files directly, then you may have to use parameters to enter the path of the excel files. As shown below, create parameters for each excel files, and the parameter value is the path to the corresponding excel file, which can then be referenced in the data source to import the excel table.
Source = Excel.Workbook(File.Contents(#"Excel1 path"), null, true)Source = Excel.Workbook(File.Contents(#"Excel2 path"), null, true)Then create the following custom columns for each table, i.e. the column value is equal to the parameter value. Then split the column to get the file name.
2. A simpler way is to put all excel files in the same folder and then use the Folder connector, which will include the name and path of each excel file.
If the excel files you want to append have the same structure, then you can just click on "Combine Files" and you will get the following result.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes, this is possible. Please provide more details about your setup, and maybe some sample files.
need to add in this custom column
the name of the excel file
thanks
- v-kkf-msft4 years ago
Community Support
Hi Anonymous ,
1. If you are connecting to these excel files directly, then you may have to use parameters to enter the path of the excel files. As shown below, create parameters for each excel files, and the parameter value is the path to the corresponding excel file, which can then be referenced in the data source to import the excel table.
Source = Excel.Workbook(File.Contents(#"Excel1 path"), null, true)Source = Excel.Workbook(File.Contents(#"Excel2 path"), null, true)Then create the following custom columns for each table, i.e. the column value is equal to the parameter value. Then split the column to get the file name.
2. A simpler way is to put all excel files in the same folder and then use the Folder connector, which will include the name and path of each excel file.
If the excel files you want to append have the same structure, then you can just click on "Combine Files" and you will get the following result.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.