Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello everyone.
Please I need help on how to convert positive values within a column to negative values.
Thanks
Solved! Go to Solution.
Assuming Data is column name
In a Custom column, you can put following formula
=if Number.Sign([Data])=1 then -1*[Data] else [Data]
if you don't want to use Custom column but want to do it in-place column, then next step is
=Table.TransformColumns(#"Changed Type",{{"Data", each if Number.Sign(_)=1 then -1*_ else _}})
Here you will need to replace #"Changed Type" with your previous step
If your column has all positive values only,
= Table.TransformColumns(#"Changed Type", {{"Data", each _ * -1}})
Assuming Data is column name
In a Custom column, you can put following formula
=if Number.Sign([Data])=1 then -1*[Data] else [Data]
if you don't want to use Custom column but want to do it in-place column, then next step is
=Table.TransformColumns(#"Changed Type",{{"Data", each if Number.Sign(_)=1 then -1*_ else _}})
Here you will need to replace #"Changed Type" with your previous step
If your column has all positive values only,
= Table.TransformColumns(#"Changed Type", {{"Data", each _ * -1}})
use Transform, Standard> Multiply -1