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
Anonymous
Not applicable

Upload newest files based on times which changes for every update

Hi

 

I have a problem and I can't seem to find a similar problem here. 

 

I have a folder with different XML files, these are marked in the filename with their date and time of extraction. These files are extracted several times a day. Now, I don't have problem with getting the files for the newest date (today), what I am struggling with is getting the newest file on today. The format of the date is DDMMYY, and for the time it is HHMMSS

 

Example:

"name1_120220_150007"

"name2_130220_010014"

"name1_130220_080018"

"name3_130220_010022"

"name1_130220_010110"

"name2_130220_120817"

 

Now, the name1 files have the same type of data, while name2 and name3 have different type of data. All these names have multiple extractions per day resulting in the filenames in the example.

So for the example above I want to update my PowerBI file with the files "name1_130220_080018", "name2_130220_120817" and "name3_130220_010022". Is there a way to get the latest file maybe by picking the file with the "highest" number after the last _?

 

 

 

 

 

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

Add a custom column with the following code:

Text.BeforeDelimiter([FileName], "_")

 

Then do a group by this new colum and select the maximum value of the FileName column this will return only the list of files you need. then use this list to treat the files I'm assuming you are using a custom function to treat the files.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.