Forum Discussion

aachavez13's avatar
aachavez13
Regular Visitor
3 years ago
Solved

Extract date from text column

Relativly new to Power Query, needing some help on how I would go about extracting the date from a column that has multiple dates / text.  Column contains data such as below, I would like to have the...
  • jgordon11's avatar
    jgordon11
    3 years ago

    = Table.AddColumn(Source, "Custom", each try Date.From([All Due Dates]) otherwise Date.From(Text.Select([All Due Dates], {"/", "0".."9"})))

  • BA_Pete's avatar
    BA_Pete
    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