Forum Discussion
markquisquirin
3 years agoFrequent Visitor
Adding new column based on another column criteria on the same table
Hello, I have this problem where I wanted to add a new column based on the criteria from another column on the same table. Below is what my table looks like. Number Link Type Party ID 5...
lbendlin
Super User
3 years agolet
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjUwsDRV0lEKcgYSCkqxOgghRxcMIWd/XwyxYJCQoZGxiSmKcDhY3MzcwtJAKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Number = _t, #"Link Type" = _t, #"Party ID" = _t]),
#"Added Custom" = Table.AddColumn(Source, "WSM", each Table.SelectRows(Source,each [Link Type]="WSM"){0}[Party ID])
in
#"Added Custom"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".
- markquisquirin3 years agoFrequent Visitor
Hi Ibendlin, wow! This worked, thanks. 🙂