cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Super User III
Super User III

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

6 REPLIES 6
Highlighted
Super User III
Super User III

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

Highlighted
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)
Highlighted

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.

Highlighted

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

Specializing in Power Query Formula Language (M)
Highlighted

@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,

Highlighted

how to get yesterdays date.... ??

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors