Forum Discussion

ngadiez's avatar
ngadiez
Helper II
9 years ago

Append Data from different source and Add custom column depends on the source

I would like to create a table in power query where every end month I will append more data for this table.

I want to add 1 more custom column to this table so I can know which row belongs to which month data.

 

Is it possible to do that?

 

How to automate this?

6 Replies

  • Kinsey's avatar
    Kinsey
    Advocate III

    I have the same issue, but mine is knowing the source of the rows of data which have been appended together (for later analysis). Surely there is a way to add an identifier column to the resulting dataset which shows the source of each row (in my example I have 3 source files for different departments and need to know which rows belong to which departments)? Please help

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ngadiez

    Do you look for something like that?

     

    If yes, what kind of source do you use?

    And do you want to add the month date automatically (for example date of import) or is there a column in the source which could be used?

    • ngadiez's avatar
      ngadiez
      Helper II

      Yes something like that.

       

      The file is in txt.

      I don't know whether there is a better way.

       

      There is no Extract Date in the table only the file name which started with 2017-01, 2017-02, etc.

      My approach is to add the table one by one and then add in the custom column manually like 1701, 1702, etc.

      then append the table, in which I will do additional steps.

       

      Because I understand from MS Access there is something like parameters where we can input the new column data.

      Don't know whether Power Query can do that. I tried the parameter in Query but it is not like MS Access.

       

       

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        1. Create a folder. Put all your csv in this folder.

        2. Back in Power BI Desktop load instead of the csv file the folder.

         

        By connecting to a folder, you can import data from multiple files at once, such as a series of Excel files of CSV files.

        The files contained within your selected folder appear in Query Editor as binary content, and clicking the double-arrow icon at the top of the Content column loads their values.


        Hope this helps.