Forum Discussion
Vemul
2 years agoHelper I
Replace Values Based on Condition n Power Query
Hi Team, please help, what I am looking is based on belwo table, if Client is 99638 and Type is "Sample" then Client value to be changed to 99999. if Client is 99567 and Type is "Sample" then...
- 2 years ago
Hi Vemul,
Before
After
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WsrQ0M7ZQ0lHyL8pMz8xLzFGK1QEJmpqZAwWDE3MLclKhQhB1KEIQVQitsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Client = _t, Type = _t]), ChangedType = Table.TransformColumnTypes(Source,{{"Client", Int64.Type}}), ReplacedClient = Table.ReplaceValue(ChangedType, each [Client] = 99638 and [Type] = "Sample", each 99999, (x,y,z)=> if y then z else x, {"Client"} ) in ReplacedClient
Vemul
2 years agoHelper I
Thank you, Solution worked as expected.