Forum Discussion
mechanix85
9 years agoHelper I
Table.TransformColumns by criteria
Hello! How can I convert a column by a condition? Something like this if type = №2 and type2 = true then List.Product({_, -1}) else List.Product({_, 1}) ???
- 9 years ago
Hi mechanix85,
You could try this. It worked in my test.
#"Replaced Value" = Table.ReplaceValue(#"Changed Type1", each [value], each if [type] = "No2" and [type2] = true then [value] * -1 else [value] * 1, Replacer.ReplaceValue,{"value"}),Best Regards!
Dale
mechanix85
9 years agoHelper I
v-jiascu-msft, Yes, i can do this, but I do not want to add new column... Table.TransformColumns can do it without new column, but I can not understand how to add a condition
v-jiascu-msft
9 years agoMicrosoft Employee
Hi mechanix85,
You could try this. It worked in my test.
#"Replaced Value" =
Table.ReplaceValue(#"Changed Type1",
each [value],
each if [type] = "No2" and [type2] = true then [value] * -1 else [value] * 1,
Replacer.ReplaceValue,{"value"}),
Best Regards!
Dale