Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Replace a column value with dynamic value

Name Anu Tomy Mikhayel Jan-25 George Thomas Jerry   I have a table with sample data like this, i want to replace the entire column with the value Jan -25, the value of mo...
  • dufoq3's avatar
    1 year ago

    Hi Anonymous, check this:

     

    Output

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcswrVYrViVYKyc+tBDN8M7MzEitTc8Acr8Q8XQMjMNM9Nb8oPRWiNiM/N7EYoiC1qAioLxYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
        Date = List.Select(Source[Name], (x)=> (try Date.FromText("01-" & x) otherwise false) is date){0},
        Repalced = Table.TransformColumns(Source, {"Name", each Date, type text})
    in
        Repalced