Forum Discussion
TBoat
3 years agoFrequent Visitor
Multi-conditional find replace in Data Power Query from two seperate columns
Hi, I have an issue with some of the data being miss classified in my report. I am trying to find a solution on the Power Bi side instead of changing it in the data base. In Power Query does anyo...
TBoat
3 years agoFrequent Visitor
Hi - lbendlin
Thanks for getting back to me. Interesting. I would like to see how this function works in Power Query. I attached a sample of what my data looks like:
In this case I would like to Replace cg_sort_order " 7 " with " 8 " - only if ca_AcctNumber is "4650"and da_AcctNumber is "4191".
Thanks so much for your help!
Trevor
lbendlin
Super User
3 years agoplease provide the sample data in usable format. I can't work with screenshots.
- TBoat3 years agoFrequent Visitor
Okay, I think I added this correctly. Thanks for the help!
- lbendlin3 years ago
Super User
Here is a simple version. For more complex scenarios you can write a custom replacer function.
Table.ReplaceValue(Source,each [cg_sort_order],each if [cg_sort_order]="7" and [ca_AcctNumber]="4650" and [da_AcctNumber]="4191" then "8" else [cg_sort_order],Replacer.ReplaceValue,{"cg_sort_order"})see attached.