Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Auto generate upload date per row

Dear all,

 

Can someone help me?

 

I am generating an export to Excel two times a week and then I upload the file to Power BI Desktop to prepare an overview, actual every export includes all recent data. Example:

 

Export 15-06-2021 includes all data from 01-01-2021 YTD

Export 18-06-2021 includes all data from 01-01-2021 YTD

 

What I want is to understand if Power BI can automatically generate a date per row for each upload so i can easly know which data was exported on 15-06 and which on 18-06. This way I can create a table in Power BI with upload date + total revenue.

 

I hope its clear 🙂

  • Hi Anonymous,

     

    Add to the above:

    Expand content:

    Reserved the 'Date created' column.(Return to selected step and remove other steps)

    Remove column 'Content', and expand table.

    Then you can refresh data after add new file.

     

    If you still have some question, please don't hesitate to let me known.‌‌

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

     

     

     

8 Replies

  • In Power Query use the Folder connector (rather than connecting to an individual file).  That will then pull in the file names too.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I did that already!

  • Usually what you do in such a scenario is to include the source file name in your Power Query steps, which in turn likely has your date stamp as part of the name.

    • Anonymous's avatar
      Anonymous
      Not applicable

      How!?

  • Great.  Maybe you can show a sanitized version of your Power Query code?

  • v-xulin-mstf's avatar
    v-xulin-mstf
    Community Support

    Hi Anonymous,

     

    Get data from floders:

    You can get:

    In your case, 'Upload date' is Date created.

    Sorted by Date created:

    Keep top rows:

    You can get:

    Refresh data after uploading new files to folders, you can get:

     

    If you still have some question, please don't hesitate to let me known.‌‌

     

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-xulin-mstf 


      Thank you for your reply.

       

      I have already applied these steps, but the question is:

       

      How can I add the file creation date to the table "newfile1" after expending it?

       

      Every week I am receiving two CSV files to be added in Power BI, but instead of adding a custom column with the upload date every week, I want to automate this process, once the file is added to the power bi folder an extra column is then generated with the upload date of the file.

       

      Further, let say you have 1 CSV file which gets updated every week, how can I add an incremental upload date to the table after refreshing? So I know which rows are added weekly to the table.

       

      I hope you get what I mean 🙂 

      • v-xulin-mstf's avatar
        v-xulin-mstf
        Community Support

        Hi Anonymous,

         

        Add to the above:

        Expand content:

        Reserved the 'Date created' column.(Return to selected step and remove other steps)

        Remove column 'Content', and expand table.

        Then you can refresh data after add new file.

         

        If you still have some question, please don't hesitate to let me known.‌‌

        Best Regards,

        Link

         

        Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!