Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 months ago
Solved

Replace all values with 0 in column

Morning - I am trying to achieve something that I was hoping would be quite simple in Power Query  I have a large data set and reports already build up, but what I need to do is change $ Net value f...
  • ANVS's avatar
    9 months ago

    Hello Anonymous 

    You can achieve the above scenario using M language in Power Query.

    1. Go to Power Query Editor → select your table.

    2. Select the “$ Net” column.

    3. Go to the Formula Bar and replace the current step for $ Net with this custom logic as follows:

    = Table.TransformColumns(
    PreviousStepName,
    {{"$ Net", each if [Company] = "A" then 0 else _, type number}}
    )

    Hope, I answered/resolved your query. Please give some kudos and mark this post as "Accepted Solution" if you find it useful.