Forum Discussion
Anonymous
1 year agoNot applicable
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...
- 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
dufoq3
1 year agoCommunity Champion
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