Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there,
first time posting but I have been looking around a lot.
I'm trying to create a custom column which identifies for which values in column B exists in column A (i.e. they do not need to exist on the same row).
For example:
column A column B custom column
orange banana FALSE
apple orange TRUE
mango pear FALSE
I have seen solutions in DAX although I need this in powerquery, because I intend to pivot the table depending on the results.
From this article: https://towardsdatascience.com/power-bi-functions-list-contains-list-containsany-list-containsall-87... I tried to use the following formula:
= Table.AddColumn(#"Previous Step", "Custom", each List.Contains({#"Previous Step"[column A]},[column B]))
But it has not worked (everything outputs as false).
Thanks in advance!
Solved! Go to Solution.
Thanks,
solution ended up being: = Table.AddColumn(#"Previous Step", "Custom", each List.Contains(#"Previous Step"[column A], [column B]))
Thanks,
solution ended up being: = Table.AddColumn(#"Previous Step", "Custom", each List.Contains(#"Previous Step"[column A], [column B]))
Darn I didn't realize that I left your opening brace in there!
--Nate
It'll work if you rewrite it like:
= Table.AddColumn(#"Previous Step", "Custom", each List.Contains({#"Previous Step[column A], [column B]))
--Nate
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |