Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 trying to enter into an if statement somehow:
Table.Contains(MyTable,[B],[A])
Which is returing a cyclical reference error.
Assuming this is in AddColumns...
Just use:
if Text.Contains([A], [B]) then [B] else null
Hi @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?
Oh, just use:
if [A] = [B] then [A] else null
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
7 | |
6 | |
6 |