Forum Discussion
lornafnb
4 years agoHelper I
Multiple date formats in column
Good day - my first post on the Forum! :)- I'm reading from an Excel file, and the format of the date column is either 2021/11/08, or March '22 (in this case, it can default to 2022/11/01). I su...
- 4 years ago
Leave everything, in a custom column put this. That's it.
= Date.From(if Text.Contains(Text.From([Live date]),"'") then "1"&Text.Replace([Live date],"'","") else [Live date])If you want to convert this column to a date, select column - Transform tab - Detect data type
Vijay_A_Verma
4 years agoMost Valuable Professional
Can you click on one of the errors and post the error here? To have the column in date format, use below step (Replace Source with your previous step)
= Table.AddColumn(Source, "Custom", each Date.From(if Text.Contains([Live date],"'") then "1"&Text.Replace([Live date],"'","") else[Live date]), type date)OR you can select the Custom column - Transform menu - Detect data type
lornafnb
4 years agoHelper I
I'm so sorry - I am really stupid with this.
1. The error message that the values cannot be converted to text - so your thinking that it needs to be converted to date is correct.
2. In your suggestion - it starts with Table.Addcolumn....why is that - I still have a query, not a table...
thanks