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
JulioAlmeida
New Member

Create measure to display string from file name used in a query

Hi,

 

I'm trying to make a automated/dynamic way to display the date of data using the file name.

Someting like this:

file name: BI_Execucao_Detalhada_Semanal_08.09.2023_.xlsx

 

and display the message/tex:

 

"last update: september 8"

 

Can anyone help me?

Any suggestions?

Best regards,

 

Júlio Almeida

4 REPLIES 4
isjoycewang
Solution Supplier
Solution Supplier

Hi @JulioAlmeida ,

 

I think below post explains clearly how to extract file name in the Power Query editor. Hope this helps!
Solved: Get current file name within PowerQuery Editor - Microsoft Fabric Community

Is there a way to do this - to grab the filename of the source of the table - and store that filename as eaither a Measure (preferred) or calculated column?
----->> WITHOUT using a folder import or some solution that involves Sharepoint?  <<-----

Hi @isjoycewang ,

 

Thanks for the replay.

Currently I have implemented the above solution with a card, but I'm looking a more "straightforward" since all the data in the Power BI project querys from that file and I replace it in an weekly base.

After I change the source file of the query the date in the card or other visual element I need the value to be aotomatic updated.

And I'm looking to it with a function that concatenates a text similar to this:

 

updatedate = concat("last update: "; <string in file>)

 

Is that possible?

Best regards,

 

Julio Almeida

 

Hi @JulioAlmeida,

 

Is it possible for you to filter the latest file using the date (or date in your file name) in the Power Query editor? This should always produce the latest one without manually update.

isjoycewang_0-1694572383620.png

 

If not, I think that adding a cell in excel file might be simpler.
Discussion for reference: Solved: get current file name - Microsoft Fabric Community

 

= CELL("filename")

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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