Forum Discussion

drivas771994's avatar
drivas771994
Icon for Helper II rankHelper II
5 years ago
Solved

Power Bi recognizing changing date for a file daily

Hi,

I have a csv that automatically updates itself daily with new data. The problem is in the code that was written it changes the name of the csv to the most current date. Is there a way I can get power bi to recognize and accept that it is the same file with just a different name so that it will update itself each day?

 

Thanks,

Dan

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    5 years ago

    Hi drivas771994 ,

     

    You need to connect a folder, please refer the following steps.

     

    1. Create a folder to put your file.

     

     

    2. Then open Power BI Desktop, select Get date -> folder to connect the folder you create. You need to select Combine and Transform data.

     

     

    3. We need to remove the first column.

     

     

    4. Now it will be updated according to the changes in your data.

    We change the file name and click the refresh,

     

     

     

    If you have any question, please kindly ask here and we will try to resolve it.

     

    Best regards,

     

    Community Support Team _ zhenbw

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

9 Replies

  • arvindsingh802's avatar
    arvindsingh802
    Icon for Community Champion rankCommunity Champion

    Considering your file name = FileNamemmddyyy.csv

    Rather connecting directly to file use below steps

    1. Select Folder as source
    2. Aplly filter on file name - Begin with "FileName"
    3. Click on Binary to extract the data

    • drivas771994's avatar
      drivas771994
      Icon for Helper II rankHelper II

      Ok. So how would I get power bi to recognize when I try to refresh it. The problem is that I have to change the source settings daily to get it to look at the renamed file since it isn't recognizing it with the new name. I've used to folder source app since it though that would bypass it.

       

      Example: 

      Original File: Data10-10

      Next Day: Data10-11

      2nd Day After: Data10-12

       

      Power Bi is giving me the error that it can't find the file "Data10-10" since it's not the same name the next day.

      • mahoneypat's avatar
        mahoneypat
        Icon for Microsoft Employee rankMicrosoft Employee

        This is doable.  Use a Folder connector so you see all the files in your query, then sort by one of the columns (modified date, your filename, or values you extract from the filename), so the most recent file is on top.  Then you can just keep the top row, and expand the column with your Data (or you can reference the top row data column by inserting a step and using this syntax for the previous step

         

        = #"Previous Step"{0}[Data]

         

        That will get the first row of the Data column (rename if needed) from the table in the Previous Step (rename that to whatever that is called, like #"Changed Type", etc.

         

        Regards,

        Pat

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi how about if my source file has folders by dates example : 15 April 24,16 April 24 ,etc and each folder has excel files with the respective dates.How to link that to the Power BI Automatically ?