Forum Discussion

jts_'s avatar
jts_
Icon for Helper I rankHelper I
3 years ago

Invoke Custom Function: Similar set of columns but different format of headers

Hi! I'd like to have some help on the invoke custom functions in Power Query.

 

I have several (approximately 40) Excel sheets downloaded from the system for clients' order data. Each file represents each client's order records during the selected date range. One of the drawbacks is that, when exported, it does not include any useful information, for example, customer name, in the file name. Instead, it simply shows as "Exported_YYYYMMDD" for every exported file.

 

I'd like to put all these files into a folder and create the Invoke Custom Function in Power Query and process them in bulk. Even though each file contains the same set/ sequence of columns, their header is slightly different from one to another BUT I need the information from the header to be part of data processing.

 

 

As the example picture shows, I am not able to get the customer name from the file name when exported. I will need to capture it from the header of  "Cus_Name". But each file has a different amount of header before the main table. I am looking for any creative ideas to work around this issue. I appreciate your help and insights in advance! Thanks!

1 Reply