Forum Discussion

MartinDUK's avatar
MartinDUK
New Member
3 years ago

How do I Use Text from Cell Drill Down as Data Source and File location.

 

I have files in a Network Folder and have written a query to get the list of files from a Folder.

Filtered the File name for the relevent file.

Filtered the Latest file.

Drilled down in the Cell to get a Text Value for the File location.

 

 

How do I use this value as a Data Source?

 

Regards,

 

Martin.

 

 

 

14 Replies

  • Try

     

    Let

    Source = FilePath,

    Yoursteps = ...

    in

    Yoursteps

     

    ??

  • eduardosa's avatar
    eduardosa
    Frequent Visitor

    MartinDUK,

     

    Set data source as being a Folder, and from this step do all the transformations you require to select the latest file.

     

     

    Regards,

    Eduardo

    • MartinDUK's avatar
      MartinDUK
      New Member

      Hello Eduardosa,  I have already done that as stated in my origional question  🙂

      • eduardosa's avatar
        eduardosa
        Frequent Visitor

        Hi MartinDUK,

         

        Then can you please show all the steps you're doing?

        Something like this.

         

        If I understoud correctly you want the content of the latest file.

        For this do:

        • Set Source data a Folder,
        • Sort by create date,
        • Add index, start with 1,
        • filter index by 1
        • expand file content.

        Give it a try.

  • Hi, MartinDUK use Csv.Document(FilePath) Csv.Document(File.Contents(FilePath)). Add optional parameters if you need to (delimiter, number of columns etc.). Simply read (get data from) that CSV file (PQ creates all parameters for you) and replace "...path..." value by your FilePath query name. 

    • MartinDUK's avatar
      MartinDUK
      New Member

      I'm sorry I don't understand that, im quite new to Power BI.

      All I want to do is select a file from a Network Drive, the File name changes every day by adding the Date at the end of the File. So I did the query to filter the file name and location but do not have the knowledge to use this txt to get the Excel file from the Network Location.

      • AlienSx's avatar
        AlienSx
        Super User

        create blank query, open it with Advanced Editor and literally write the following 

         

        let 
          // Source = Csv.Document(FilePath) - wrong!
           Source = Csv.Document(File.Contents(FilePath))
        in Source

         

        what do you get?