Forum Discussion

NewPBIe's avatar
NewPBIe
Helper II
2 years ago
Solved

csv Folder-Source with slightly different columns

Hello everybody, I need to dynamically adapt the list of columns from multiple csv files with slightly different columns. I have have a folder-source, where periodically new csv are loaded. Also ...
  • dk_dk's avatar
    2 years ago

    Hi NewPBIe ,

    If you know all the possible column names that can occur, you can do the following:

     

    Create a csv file in the same folder with all the other files (lets call it "csv_master") that contains all the possible column names, with 0 values.

    When you connect to your folder, at the merge files step, make sure you select csv_master as the sample file:


    and that should be it. The result should look something like this:

    You can filter out csv_master from the Source.Name column, replace the nulls with blank or zeros as needed and you should be good to go.

    If later on more columns are added to one of the csvs, you should be able to just come back to the master and add the extra columns.

    Hope this works, let me know if you have any questions.