Power Query M code
let
Source = YourTable,
AddedCorrected = Table.TransformColumns(
Source,
{{"Amount", each if _ < 0 then 0 else _, type number}}
)
in
AddedCorrected
Replaces a column's value only where a condition is true, leaving every other row untouched.
let
Source = YourTable,
AddedCorrected = Table.TransformColumns(
Source,
{{"Amount", each if _ < 0 then 0 else _, type number}}
)
in
AddedCorrected
The underscore (_) refers to the current cell's value inside Table.TransformColumns.
Browse all 145 snippets in the Power Query M Code Snippets, or search the library for something similar to Conditionally Replace Values in Specific Rows Only.