Forum Discussion

KH24's avatar
KH24
New Member
2 years ago
Solved

combined files do not show all column values

Hi, I tried to find an answer but could not. So here is my question. I have 4 Excel files that I load from Sharepoint into my PBI file via Transform and then combine into 1 query. Now these files s...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, KH24 

    When I reviewed the posts in our community, I found that no one had replied to this post yet. After reading it, I have the following reference ideas:

    You need to make sure that the column headers are consistent between the files. Before merging files, make sure that all files have a consistent set of column headers, including placeholders for missing columns in some files. You can do this manually in Excel before you load a file into Power BI or use Power Query to programmatically add missing columns.

    Use Power Query's Table.Combine function: Instead of adding an empty table with column names, use the function in Power Query directly to merge tables. Power Query should automatically align columns with the same name and populate missing columns with null values if the data is not present. Here's a simplified approach

    let
    Source = SharePoint.Contents("YourSharePointSiteURL", [ApiVersion = 15]),
    CombinedTables = Table.Combine({Table1, Table2, Table3, Table4})
    in
    CombinedTables

    After you merge the tables, you may need to manually adjust the resulting tables to ensure that all columns are properly aligned and that the data type is set correctly for each column.

    Make sure that steps in Power Query, especially any transformations or column removals, don't inadvertently remove or alter data in extra columns.

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.