Latest Enterprise DNA Initiatives

Convert negative numbers to positive

Hi everyone, How can I easily change in power query negative numbers to positive without adding a new column?
image

Hi @Mario

You can use Table.TransformColumns and Number.Abs for that. Nice thing is you don’t even have to write any M code to implement that step. Just select the column, go to

  1. Transform on the Ribbon
  2. Select Scientific and then Absolute Value

And this code will be created for you:

Table.TransformColumns(
    #"Your previous step name here",
    {{"sales_qty", Number.Abs, Int64.Type}}
)

All done :wink:

2 Likes