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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JChris
Helper II
Helper II

Is it possible to use a file that get its name changed daily, as a source file?

I have the following file behavior:

 

 

(Today) 28-Apr-2017: STATIC_PATH\20170428-STATIC_FILENAME
(Tomorrow) 29-Apr-2017: STATIC_PATH\20170429-STATIC_FILENAME
...
(Monday) 01-May-2017: STATIC_PATH\20170501-STATIC_FILENAME
(Tuesday) 02-May-2017: STATIC_PATH\20170502-STATIC_FILENAME
And so on...

 

The filename changes on a daily basis, more especifically the date part. Is there a way to use it as a source in PBI automatically, so I don't need to go into source settings everyday and update the source path by hand?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @JChris,

 

Check this video tutorial it as what you are looking for.

 

 

https://community.powerbi.com/t5/Video-Tips-and-Tricks/Combine-CSVs-and-Keep-the-File-Name/m-p/15152...

 

Regards

MFelix


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



View solution in original post

7 REPLIES 7

Please watch this video 
Here the file name keeps changing within a folder still fetchs the files
https://youtu.be/4UfkhF6uGcw

MarcelBeug
Community Champion
Community Champion

If you only want to get the file with todays date, you can use:

 

"STATIC_PATH\"&Date.ToText(DateTime.Date(DateTime.LocalNow()),"yyyyMMdd")&"-STATIC_FILENAME"

Specializing in Power Query Formula Language (M)

how to get yesterdays date.... ??

I want to get the file that is in the STATIC_PATH, no matter the date, the file is replaced, so yesterday file get out and todays get in the folder. Something like a regex: .*-STATIC_FILENAME would do if regex was allowed.

@JChris

 

You can create a function to pass the file path and file name. Then you can iterator all files under that folder and combine them into one dataset. For more details, please refer to this blog: USE POWER QUERY’S GET DATA FROM FOLDER TO GET DATA FROM MULTIPLE EXCEL FILES

 

Regards,

Then you can use "Get files from folder" as suggested by @MFelix

Specializing in Power Query Formula Language (M)
MFelix
Super User
Super User

Hi @JChris,

 

Check this video tutorial it as what you are looking for.

 

 

https://community.powerbi.com/t5/Video-Tips-and-Tricks/Combine-CSVs-and-Keep-the-File-Name/m-p/15152...

 

Regards

MFelix


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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors