Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MartinDUK
New Member

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.

 

MartinDUK_0-1684233222894.png

 

How do I use this value as a Data Source?

 

Regards,

 

Martin.

 

 

 

14 REPLIES 14
AlienSx
Super User
Super User

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. 

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.

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?  

I get the file and File Path, which I've already got.

How do i use this to import the Excel file displayed?

 

MartinDUK_0-1684236971341.png

 

 

I am sorry, my fault. Try this please

let 
  Source = Csv.Document(File.Contents(FilePath))
in Source
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.

 

eduardosa_0-1684235329222.png

 

Regards,

Eduardo

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

Hi MartinDUK,

 

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

Something like this.

eduardosa_0-1684236031499.png

 

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.

I do not know what the following means ...

  • Add index, start with 1,
  • filter index by 1
  • expand file content.

I have got the file and File Path, how do i use this to import the Excel file displayed?

 

MartinDUK_1-1684237111081.png

 

 

MartinDUK let me breakdown the steps for you.

 

So starting with accessing data on a Folder:

 

eduardosa_0-1684237459683.png

 

  • Sort by creation date

eduardosa_1-1684237568091.png

 

  • Add index

eduardosa_2-1684237596542.png

 

  • Filter by 1 ( to get latest file)

eduardosa_3-1684237671157.png

 

  • Get file content

eduardosa_4-1684237745442.png

 

Regards

 

 

I found easy to understand and follow instructions here....

 

Thankyou to those who offered advice, much appreciated 🙂

 

https://www.youtube.com/watch?v=pHDRKNjuwmU&ab_channel=BI-LingualAnalytics

MartinDUK
New Member

Unfortunately this didn't work  😞  

 

MartinDUK_0-1684234833445.png

 

Einomi
Helper V
Helper V

Try

 

Let

Source = FilePath,

Yoursteps = ...

in

Yoursteps

 

??

I found easy to understand and follow instructions here....

 

Thankyou to those who offered advice, much appreciated 🙂

 

https://www.youtube.com/watch?v=pHDRKNjuwmU&ab_channel=BI-LingualAnalytics

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors