Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

sharepoint folder - missing column names

Hi all, Ive run into interesting behaviour of Power query. Problem: I have 2 excel files stored on sharepoint. Some columns in both excel files have header (Serial number), some dont (Empty header...
  • BeaBF's avatar
    1 year ago

    Anonymous Hi! Yes, this is expected behavior in Power Query when combining files with SharePoint Folder or other folder-based connectors. Here’s why it happens and what you can do about it.

    When using SharePoint Folder to combine multiple files, Power Query tries to align columns based on headers. If one file has an unnamed (empty) column header and another file has a named header (e.g., "Serial number"), Power Query treats them as different columns.

    If a file has an unnamed column, Power Query may not recognize it properly during automatic column mapping, leading to null values.
    If another file has a named column in the same position, Power Query keeps that name and only combines matching headers.
    Since File1 has an unnamed header, Power Query still picks up the data. But for File2, it ignores the unnamed column because there's no corresponding match.

    Solution:

    • Load the data without automatically promoting headers (disable "Use First Row as Headers" in the Source step).
    • Manually promote the first row as headers later in the transformation process.
    • Replace empty column names dynamically using a custom transformation step.

      If it's ok, please accept my answer as solution!
      BBF