Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
OleMcDonald
Helper I
Helper I

List.Contains True/False

My [All Products] column has a number of semi-colon delimited values. 

The individaul values may appear in my tRefreshProducts table

 

I am trying to create a new column with "True" if my [All Products] contains any of my tRefreshProducts[Products] and false if not.

 

This is throwing an Eof expected error

 

 

 

 

List.Contains(tRefreshProducts[Products],[All Products]), "True", "False"

 

 

 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

 

List.Contains(tRefreshProducts[Products],[All Products],(x,y)=>Text.Contains(y,x))

or

List.ContainsAny(tRefreshProducts[Products],Text.Split([All Products],";"))

 

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

 

List.Contains(tRefreshProducts[Products],[All Products],(x,y)=>Text.Contains(y,x))

or

List.ContainsAny(tRefreshProducts[Products],Text.Split([All Products],";"))

 

PhilipTreacy
Super User
Super User

Hi @OleMcDonald 

If your [Products] and [All Products] columns contain text then try this

 

if List.ContainsAny(Text.ToList(tRefreshProducts[Products]), Text.ToList([All Products])) then true else false

 

 

If the columns already contain lists then use this

 

if List.ContainsAny(tRefreshProducts[Products], [All Products]) then true else false

 

 

If neither of these work please post sample data showing the contents of the columns.

regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.