Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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([Source.Name], "DATE"))
I am trying to replace "DATE" with Date.toFrom(DateTime.LocalNow()), so that this can be dynamic, but this throws a conversion error. Can anyone help with this?
Thanks!
Solved! Go to Solution.
Date.ToText(Date.From(DateTime.LocalNow()),[Format="ddMMMyyyy"])
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)
Hi thanks, this is great. I used Text.From(DateTime.Date( DateTime.LocalNow() )) and recieved the value 11/03/23, which is great. I hate to bug but unfortunately / cannot be used in file names. How would I got about dropping them?
Date.ToText(Date.From(DateTime.LocalNow()),[Format="ddMMMyyyy"])
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |