Forum Discussion
Validate if value(String) is a date or not using M Language
- 4 years ago
Your function would look like:
try Date.FromText([DateColumn]) <> null otherwise false
- 4 years ago
You will need to use complete formula alongwith try to suppress the error. Don't omit try.....
=try Value.Is(Date.From([Date Field]), type date) otherwise false
If you want to convert it to date in a custom column
try Date.From([Date Field]) otherwise null
Hi
formula...Value.Is(Date.From([Date Field]), type date)
This is partially working, however if the value is random text, I get am error in that row. I may need need rethink the solution.
Chris
You will need to use complete formula alongwith try to suppress the error. Don't omit try.....
=try Value.Is(Date.From([Date Field]), type date) otherwise false
If you want to convert it to date in a custom column
try Date.From([Date Field]) otherwise null
- Anonymous4 years agoNot applicable
Perfect, I now see how this works, yes it is working great and gives me a good starting point, thanks for the advice.