Forum Discussion
Anonymous
5 years agoNot applicable
Transformation to Multiply and Divide in the Same Step
Guys, what is wrong with this script? = Table.TransformColumns(#"Expanded Table Column1", {{"Avg Talk", each _ *[Interactions]/ 86400, type number}}) What I aim to is to multiply column: Avg ...
- 5 years ago
Table.TransformColumns can access only each column in isolation. We have to use below walk around method (this solution is from power-query-transform-a-column-based-on-another-column 😞
= Table.FromRecords(Table.TransformRows(#"Changed Type", (r)=> Record.TransformFields(r,{{"Avg Talk", each _ * r[Interactions]/86400}})))
xzmiche
Resolver I
5 years ago= Table.ReplaceValue(#"Changed Type",each [Avg Talk],each [Avg Talk]*[Interactions],Replacer.ReplaceValue,{"Avg Talk"})Anonymous
5 years agoNot applicable
Problem is with the replacing method that you could apply the step in 1 column only, I was hoping to apply in many columns thru 1 step.
- xzmiche5 years ago
Resolver I
Table.TransformColumns can access only each column in isolation. We have to use below walk around method (this solution is from power-query-transform-a-column-based-on-another-column 😞
= Table.FromRecords(Table.TransformRows(#"Changed Type", (r)=> Record.TransformFields(r,{{"Avg Talk", each _ * r[Interactions]/86400}})))- Anonymous5 years agoNot applicable
Works perfectly, thanks