Forum Discussion
Update a value based on another value
- 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 use replace function in PowerQuery, replace null with 685
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.
- parry2k7 years agoSuper 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.
- Anonymous7 years agoNot applicable
Could you illustrate how I would write that? Sorry, I am very VERY new to PowerBI - Thank you!
- Anonymous7 years agoNot applicable
Could you illustrate how I would write that? Sorry, I am very VERY new to PowerBI - Thank you!
- Anonymous7 years agoNot applicable
I tried to follow that logic but it doesn't like my attempt:
#"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns1",{"ID", "Name", "Period", "Year", "Created", "Updated", "Forecast Manager ID", "Forecast Manager", "Submitted", "ResourceAllocation", "Report Period"}),
#"Replaced Value" = Table.ReplaceValue(#"Reordered Columns", each if Text.Contains([Forecast Manager ID],"685") then "Rita Carnes" else [Forecast Manager])
in
#"Replaced Value"- parry2k7 years agoSuper User
Anonymous are you getting an error? Without knowing what error you are getting, it is hard to imagine what is going on.
What is data type for your [Forecast Manager Id] column?
- Anonymous7 years agoNot applicable
Expression.Error: 2 arguments were passed to a function which expects 5.
Details:
Pattern=
Arguments=List