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
Franck69
Frequent Visitor

Local Files : How to identify the directory in which the report is

Hi everybody, I need to work on a report that uses only the files that are in the same directory than the report itself.

How can I find or identify in PowerQuery the directory in which the report itself is (the file .pbix).

I can't find anything about this in the forum. I would like to be able to save my report in any directory, open it and refresh to show which files are in this directory. Txs by advance !

3 REPLIES 3
Anonymous
Not applicable

Hi @Franck69 ,

 

You can find the directory in the advanced editor.

For example, go to the advanced editor and check the code.

vstephenmsft_1-1731922073453.png

vstephenmsft_0-1731922025043.png

Or click the zigzag button in the first step.

vstephenmsft_2-1731922185740.png

vstephenmsft_3-1731922220645.png

 

 

Best Regards,

Stephen Tao

 

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

 

Sahir_Maharaj
Super User
Super User

Hello @Franck69,

 

Can you please try this approach in Power Query (Advanced Editor) of your new blank query:

let
Source = Text.FromBinary(Extension.Contents("dummy.txt")),
ReportPath = Text.Start(Source, Text.PositionOf(Source, "dummy.txt") - 1)
in
ReportPath

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Hi Sahir, it seems that this tip doesn't work. Extension.Contents function doesn't exist with a commun connector.

 Anything else ? This use case must be quite common.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors