Forum Discussion
Anonymous
7 years agoNot applicable
Get Data from Folder with Today's Date
Hi all, I need PowerQuery to go every time and search for a file that is stored in a folder with today's date. Explanation: Our raw data (the one we feed to PowerQuery) are stored to our...
- 7 years ago
Hi luke_avalle,
You could try below M code to see whether it work or not
let Source = Folder.Files("C:\Users\(username)\Documents\New folder"), #"Filtered Rows" = Table.SelectRows(Source, each ([Folder Path] = "C:\Users\zoezhi\Documents\New folder\"&Date.ToText(DateTime.Date(DateTime.LocalNow()),"yyyyMMdd")&"\")) in #"Filtered Rows"Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
7 years agoNot applicable
Anonymous I had something similar that I had to work with. The solution I found was by using a the
DateTime.LocalNow()
function in Power Query. You can then extract the day, month, and year and create a string to match the format that you use in your file structure. To manipulate the date, you can use
DateTime.ToText()
function to format the date as you wish.
Hope that helps!