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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
laganlee
Helper II
Helper II

Conditional column: Determine if a list value is contained in part of row in a column.

Hi,

 I need to see if any values in a list appear in one column of a table.

laganlee_0-1691518612292.png

 

I have got near with: if List.Contains(#"Animals",[Project Num]) then "yes" else "no"

but it misses out if the row contains other values i.e. row 1 

It has to search inside the row to see if it exists within that row.

There is the Text.Contains which might help:

  each if Text.Contains([Animal], "Cat") then "yes" else "no")

My actual list is 250, so I don't want to type each value in!

 

Would anybody have a solution?

Many thanks for looking.

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

List.Contains(#"Animals",[Project Num],(x,y)=>List.Contains(Text.SplitAny(y," ,"),x))

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

List.Contains(#"Animals",[Project Num],(x,y)=>List.Contains(Text.SplitAny(y," ,"),x))

Hi Daniel

That worked great!

Many thanks 🙂 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.