Forum Discussion
Anonymous
7 years agoNot applicable
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 ...
- 7 years ago
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"})
Anonymous
7 years agoNot applicable
I did read it so tried to write it myself based on that. Can I do it from the Replace Window?
It's really simple
Replace Value
Value to Find : Find Forecast Manager ID = 685
Replace With: Rita Carnes
parry2k
7 years agoSuper User
AnonymousThis is what is given in the post
#"Replaced Value" = Table.ReplaceValue(#"Replaced OTH",each [Gender],each
if [Surname] = "Manly" then "Male" else [Gender],Replacer.ReplaceValue,{"Gender"})
and this is what you have in the code based on what you pasted earlier it is totally different, can you use above and replace your column name and condition
#"Replaced Value" = Table.ReplaceValue(#"Reordered Columns",
each if Text.Contains([Forecast Manager ID],"685") then "Rita Carnes" else [Forecast Manager])
- parry2k7 years agoSuper User
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"}) - Anonymous7 years agoNot applicable
Thanks - That worked!