Forum Discussion
shuhn1229
2 years agoResolver I
Convert Date to String
Hi all, Pretty basic question. I'm trying to filter out all files that do not contain today's date in the file name. For this I have: Table.SelectRows(#"Renamed Columns1", each Text.Contains...
- 2 years ago
Date.ToText(Date.From(DateTime.LocalNow()),[Format="ddMMMyyyy"])
Anonymous
2 years agoNot applicable
Hi shuhn1229 - you need to consider one of the following to convert Date/DateTime to Text:
Date.ToText - PowerQuery M | Microsoft Learn
DateTime.FromText - PowerQuery M | Microsoft Learn
Text.From - PowerQuery M | Microsoft Learn
The second is probably better as you can define the format for the Datetime straight to DD-MM-YYYY (for example) without using Date.From step.
Here is good resource that list the date formats options:
Date Formatting in Power Query - Master 18 Custom Formats (gorilla.bi)