Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Update a value based on another value

I have a table and there is a null based on a missing persons name.  I want to update null with a value.  This table contains an id and name. The only person I didn't have in a table with ID 685.  I want to update Forecast Manager field with the name but only for ID 685 because the rest are fine.   This person is not an employee therefore they aren't in our HR System so this is a manually name I have to enter to the model.

  • Anonymous this will do it

     

    = Table.ReplaceValue(#"Reordered Columns",each [Forecast Manager],
    each if [Forecast Manager Id] = 685 and [Forecast Manager] = null then 685 else [Forecast Manager],
    Replacer.ReplaceValue,{"Forecast Manager"})

14 Replies

  • Anonymous use replace function in PowerQuery, replace null with 685

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks but Replace value replaces all nulls I only need to update the null for ID 685  Forecast Manager ID 685 needs a name in the Forecast Manager field.

      • parry2k's avatar
        parry2k
        Super User

        Anonymous you can put the if condition in replace formula to replace it only for the value you are interested. Here is similar post on this.