Forum Discussion
arjenbos91
3 years agoFrequent Visitor
How to escape characters in Date.FromText and Date.ToText?
When using Date.FromText or Date.ToText and putting text values (not to be parsed) it returns an error while recognizing them as time format strings. (From the official docs here) Example (Power ...
- 3 years ago
Nice creative tricks, those Text.Select with {0..9} and the Splitter By Position. I'm sticking to my convert-to-uppercase workaround. But your code will probably come in handy doing other text manipulation! Thanks 🙂
shukla
9 months agoRegular Visitor
As per this page from PowerQuery documentation:
To prevent a character from being interpreted as a format specifier, you can:
Precede it with a backslash.
Surround it with a single quote.
Surround it with two double quotes.
I tried below code and it works fine:
=Table.AddColumn(#"Added Custom", "Custom", each Date.ToText(#date(2022, 1, 1), [Format = "yyyy-MM-dd-'m'"]))