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
It looks like you can take [Table2.Col3] except where it's null otherwise [Table1.Col1].
Add a new custom column like
if [Table2.Col3] = null then [Table1.Col1] else [Table2.Col3]
There's a nice coalsece operator that makes this simpler to write:
[Table2.Col3] ?? [Table1.Col]