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
ZhangKun
1 year agoSuper User
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcswrVYrViVYKyc+tBDN8M7MzEitTc8Acr9SiIoiwe2p+UXoqRGlGfm5iMUQ+MU/XyFQpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
Repalce = Table.ReplaceValue(Source, null, List.Last(Source[Name]),(v,x,y)=>y,{"Name"})
in
RepalceAnonymous
1 year agoNot applicable
Thank you for your input. But Jan -25 doesn't necessarily come in the last row always