Forum Discussion
LittleTimmy
5 years agoNew Member
Merge multiple ReplaceValue steps
Hi, First time posting. I have multiple Applied Steps, and multiple ReplaceValue statements as follows: Step 1: "= Table.ReplaceValue(#"Changed Type","Fresh Apple","Apple",Replacer.Replac...
Jimmy801
5 years agoCommunity Champion
Hello LittleTimmy
check out this code
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcitKLc5QyC9KzEtPVYrVgQkkFhTkYOHHAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Fruit = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Fruit", type text}}),
ReplaceMore = Table.ReplaceValue
(
#"Changed Type",
each [Fruit],
each if [Fruit]= "Fresh orange" then "orange" else if [Fruit]="Fresh apple" then "apple" else [Fruit],
Replacer.ReplaceText,
{"Fruit"}
)
in
ReplaceMore
Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy