Forum Discussion

Rifdhy's avatar
Rifdhy
New Member
3 years ago
Solved

Remove Unwanted text from Date Columns

Hi There, Please note that I need to remove following unwated Strings from here and changed into Date Format.   In here I need to change values as > 1. First column Directly changed t...
  • ronrsnfld's avatar
    3 years ago

    If the date in the string is separated from other elements by a space, try adapting this example to your data:

    let
    
    //sample table
        Source = Table.FromColumns({
            {"01/04/2022",
              "N/A",
              "PROCESSED DATE: 03/11/2022"}},
              type table[processed_date=any]),
    
        #"Dates Only" = Table.TransformColumns(Source,{"processed_date", (e)=> 
            List.Sort(
                List.Transform(
                    Text.Split(e," "), 
                        each try Date.From(_, "en-US") otherwise "")){0}, type date})
    in
        #"Dates Only"

     Source

     

    Result