Forum Discussion
Extract date from text column
- 3 years ago
= Table.AddColumn(Source, "Custom", each try Date.From([All Due Dates]) otherwise Date.From(Text.Select([All Due Dates], {"/", "0".."9"})))
- 3 years ago
Hi aachavez13 ,
I see you've already accepted a solution to this thread but, for future readers, I would just update my original column calculation to this:
Text.Select(Text.From([All Due Dates]), {"/", "0".."9"})...or to explicitly output to date format to handle regional formats and two-digit years:
Date.From( Text.Select( Text.From([All Due Dates]), {"/", "0".."9"} ) )Pete
Hi aachavez13 ,
In Power Query add a new custom column like this:
Text.Select([All Due Dates], {"/", "0".."9"})
You'll then just need to change your new column to to a date data type.
Pete
- aachavez133 years agoRegular Visitor
Thank you BA_Pete,
this did help however I am now running into an Error on the lines that do not contain text and only contain a date. If possible I would also like this data to be pulled into the new column.
Due Dates
Original Due Date (new column) Original Due Date:
12/31/2022Revised Due Date:
2/16/202312/31/2022
Original Due Date: 12/31/2023 12/31/2023 12/15/2023 12/15/2023 - Error a. 12/31/2022
b. 01/31/2023
c. 10/31/2022
d. 09/31/202201/31/2023 - jgordon113 years agoResolver II
= Table.AddColumn(Source, "Custom", each try Date.From([All Due Dates]) otherwise Date.From(Text.Select([All Due Dates], {"/", "0".."9"})))
- aachavez133 years agoRegular Visitor
Thank you so much, that did the trick!!
- BA_Pete3 years agoSuper User
Hi aachavez13 ,
I see you've already accepted a solution to this thread but, for future readers, I would just update my original column calculation to this:
Text.Select(Text.From([All Due Dates]), {"/", "0".."9"})...or to explicitly output to date format to handle regional formats and two-digit years:
Date.From( Text.Select( Text.From([All Due Dates]), {"/", "0".."9"} ) )Pete