Forum Discussion

Centaur's avatar
Centaur
Helper V
4 years ago
Solved

Inconsistent Number of Columns in source data

Hello,   I am using PQ to consolidated files in a folder.  It works great.  The issue is that sometimes the files I receive are missing a column ([Branch Account]).  I have to add that column pr...
  • BA_Pete's avatar
    BA_Pete
    4 years ago

    Hi Centaur ,

     

    Yes, sounds like you're following correctly.

     

    If you need the column in a table, then you'd do my conditional add step right at the start.

     

    If you want to remove it from a table where it does exist, then you can multi-select every column that is common to each table and ISN'T [Branch Account] then right-click on one of the selected column headers and select 'Remove Other Columns'. This will remove it if it's there but not error if it's not.

     

    I originally assumed that you were using the Combine & Load function within Power Query, but I'm not sure now. If you are/were you could perform either of the above operations on your sample file to either add/remove this column from all inputs prior to combining them.

     

    Pete