I'm combining data from multiple .XML files in a specific folder using the Combine & Transform option in Power Query. The files are similar, they all contain some standard information, but the problem is that some of them have a few additional columns.
All files have the following information:
When I try to combine them with the combine and transform option with all columns I get this error message:
"An error occurred in the ‘Transform File’ query. Expression.Error: The column PROJECT' of the table wasn't found."
The reason is that Project column doesn't exist in all YYY.xml file.
However, if I instead had loaded individual XML files and then appended the files together, the combining would have worked as I would just get null in the Project column for the YYY file, which is what I want. However, adding files individually is not an option as there will a lot of files added so I can't add them individually, I need to use the folder option. I need the data in all files, so ignoring files with error is not an option and the excising columns have all the same name if they exist, so different column names is not an issue either. Also, please note that not all rows in the XXX.xml file have a project name and project number, which is fine.
The result I want:
Can anyone help me figure out how to avoid this error?
All files have the following information:
- WBS
- Period
- Amount
When I try to combine them with the combine and transform option with all columns I get this error message:
"An error occurred in the ‘Transform File’ query. Expression.Error: The column PROJECT' of the table wasn't found."
The reason is that Project column doesn't exist in all YYY.xml file.
However, if I instead had loaded individual XML files and then appended the files together, the combining would have worked as I would just get null in the Project column for the YYY file, which is what I want. However, adding files individually is not an option as there will a lot of files added so I can't add them individually, I need to use the folder option. I need the data in all files, so ignoring files with error is not an option and the excising columns have all the same name if they exist, so different column names is not an issue either. Also, please note that not all rows in the XXX.xml file have a project name and project number, which is fine.
The result I want:
Can anyone help me figure out how to avoid this error?