Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Conditionally Value Replacing Based on Another Column Value

  I’m trying to replace the date in column: [From] conditionally based on the value in column: [#"Resigned / Promoted"], if it is "Yes", the date in column: [From] would be increased by 10 days. I’v...
  • mahoneypat's avatar
    5 years ago

    I reproduced your scenario and your code worked for me.  But why are you using DateTime.LocalNow() if you are trying to adjust the From value.  Try this instead.

     

    = Table.ReplaceValue(#"Renamed Columns",each[From], each if [#"Resigned / Promoted"] = "Yes" then [From] + #duration(10,0,0,0) else [From], Replacer.ReplaceValue,{"From"})

     

    Pat