Forum Discussion
Kiteretsu
1 year agoRegular Visitor
How to replace one column value with another column value from another table?
Hello, I have this scenario where I have to get the column value replaced from another table column. For example: Let us consider that Column that needs to be replaced from Table1 has 200 re...
- 1 year ago
I'd recommend filtering Table2 for only rows with superscripts and adding a column to that filtered table that strips off the super script.
You can then merge this with Table1 on that custom column and expand Col3. Then replace Col1 with Col3 ?? Col1.
Remove Col3 if you like as a final step.
I've added these tables/queries to the file ray shared. See attached.
Note: There are many different ways to solve this problem. I recommend searching power query multiple replace online for additional ideas.
AlexisOlson
1 year agoSuper User
ray_aramburo, here's another way to do the first step in your approach that checks superscripts 0 through 9.
if List.Contains({"⁰","¹","²","³","⁴".."⁹"}, Text.End([Table2.Col3], 1)) then "Yes" else "No"
ray_aramburo
1 year agoSuper User
Thanks for the tip! This is more efficient!