Forum Discussion
tweidner
5 years agoHelper I
Power Query, M Code, Replace Value based on value in another column
Hello Everybody,
Apologies in case this was answered already in this forum, but I wasn't able to find it...
I've one column (Division) in a table where I would like to change the value if a value in another column (Country) fulfills a criteria.
Looks like:
Value in [Division] should change to "Offshore", if value in column [Country] = "Oman"
I thought I was close with the following formula, but nothing happens.
= Table.ReplaceValue(#"Changed Type", each [Country] = "Oman" , "Offshore" ,Replacer.ReplaceValue,{"Division"})
Any ideas?
Thank you & Rgds
Tobias
Table.ReplaceValue(#"Changed Type", each if [Country] = "Oman" then "Offshore" else [Division], null, (x,y,z) => y, {"Division"})
2 Replies
- CNENFRNLCommunity Champion
Table.ReplaceValue(#"Changed Type", each if [Country] = "Oman" then "Offshore" else [Division], null, (x,y,z) => y, {"Division"})