Consolidating with Power Query: Extra/Missing column Error

%3CLINGO-SUB%20id%3D%22lingo-sub-3096069%22%20slang%3D%22en-US%22%3EConsolidating%20with%20Power%20Query%3A%20Extra%2FMissing%20column%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3096069%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20size%3D%222%22%3EHello%20everyone%2C%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EI%20am%20trying%20to%20consolidate%20data%20with%20Power%20Query.%20I%20use%20get%20Data%20--%26gt%3B%20From%20Folder.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EEach%20.XLS%20(97-2003%20format)%20sheet%20that%20I%20am%20trying%20to%20consolidate%20have%20the%20same%20structure.%20So%20in%20the%20%22Transform%20Sample%20File%22%20section%2C%20I%20have%20applied%20the%20following%20steps%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E-%20The%20top%207%20rows%20are%20deleted%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E-%20My%20header%20names%20are%20in%20three%20(3)%20rows%20so%20I%20have%20transposed%20them%2C%20merged%20and%20named%20them%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E-%20I%20then%20use%20the%20merged%20headers%20as%20%22Use%20First%20Row%20as%20Headers%22%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EI%20then%20go%20into%20Other%20Queries%2C%20in%20the%20hope%20that%20my%20files%20are%20consolidated%20but%20I%20am%20left%20with%20the%20error%3A%20%22An%20error%20occurred%20in%20the%20%E2%80%98Transform%20File%E2%80%99%20query.%20Expression.Error%3A%20The%20column%20'Au_ppm_Au-GRA22'%20of%20the%20table%20wasn't%20found.%3CBR%20%2F%3EDetails%3A%3CBR%20%2F%3EAu_ppm_Au-GRA22%22%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EI%20have%20managed%20to%20consolidate%20data%20when%20all%20the%20columns%20are%20the%20same.%26nbsp%3B%3C%2FFONT%3E%3CFONT%20size%3D%222%22%3EThe%20problem%20with%20my%20data%20is%20that%20sometimes%20I%20have%20extra%20columns%20that%20appear%2C%20and%20Power%20Query%20doesn't%20like%20the%20fact%20that%20some%20columns%20are%20in%20certain%20XLS%20files%20and%20others%20are%20not.%20I%20have%20tried%20using%20my%20reference%20file%20as%20the%20one%20with%20the%20most%20columns%20but%20that%20doesn't%20seem%20to%20be%20the%20answer.%20Since%20the%20rest%20of%20my%20data%20are%20missing%20certain%20columns%20I%20get%20the%20following%20error.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3096069%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20BI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3103535%22%20slang%3D%22en-US%22%3ERe%3A%20Consolidating%20with%20Power%20Query%3A%20Extra%2FMissing%20column%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3103535%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1292893%22%20target%3D%22_blank%22%3E%40lazygeochemist%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20general%20it%20shall%20work.%20If%20you%20create%20empty%20file%20with%20maximum%20number%20of%20possible%20columns%20and%20apply%20to%20it%20exactly%20the%20same%20headers%20transformations%20as%20for%20other%20files%20with%20data%2C%20Power%20Query%20shall%20combine%20everything%20correctly.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello everyone,

 

I am trying to consolidate data with Power Query. I use get Data --> From Folder.

Each .XLS (97-2003 format) sheet that I am trying to consolidate have the same structure. So in the "Transform Sample File" section, I have applied the following steps:

- The top 7 rows are deleted

- My header names are in three (3) rows so I have transposed them, merged and named them

- I then use the merged headers as "Use First Row as Headers"

 

I then go into Other Queries, in the hope that my files are consolidated but I am left with the error: "An error occurred in the ‘Transform File’ query. Expression.Error: The column 'Au_ppm_Au-GRA22' of the table wasn't found.
Details:
Au_ppm_Au-GRA22"

 

I have managed to consolidate data when all the columns are the same. The problem with my data is that sometimes I have extra columns that appear, and Power Query doesn't like the fact that some columns are in certain XLS files and others are not. I have tried using my reference file as the one with the most columns but that doesn't seem to be the answer. Since the rest of my data are missing certain columns I get the following error.

 

 

1 Reply

@lazygeochemist 

In general it shall work. If you create empty file with maximum number of possible columns and apply to it exactly the same headers transformations as for other files with data, Power Query shall combine everything correctly.