Forum Discussion
webportal
Impactful Individual
7 years agoCheck if value in column B exists in column A
Using Power Query, I need to check for each row of MyTable if the value in column B exists in column A. If it does, then that value should be returned, then an empy field. This is the code I'm tryi...
webportal
Impactful Individual
7 years agoHi artemus
thanks, it always returns B (since B is a substring of A).
I need to make an exact comparison, is there a function for that?
artemus
Microsoft Employee
7 years agoOh, just use:
if [A] = [B] then
[A]
else
null- webportal7 years ago
Impactful Individual
Hi, that makes a comparison row by row which always returns false (null).
I need to check if column B exists in the entire column A.- artemus7 years ago
Microsoft Employee
I think I see what you are getting at.
In this case instead of adding a column, do a self join. Just do a merge on the same table using [A] and [B] as the join columns