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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Nephandi99
New Member

table selectrows looking for more than one thing

Can anyone help me figure out where I have gone wrong?  I am trying to grab more rows based on the common variations of "no note from tutor" but adding an "and" breaks the current working function

 

This one works

= Table.SelectRows(#"Exclude Blank and NA Notes", each Text.Contains([Notes], "No note from Tutor"))

 

This one is broken 

= Table.SelectRows(#"Exclude Blank and NA Notes", each Text.Contains([Notes], "No note from Tutor" and  "No notes from Tutor"))

 

 

1 ACCEPTED SOLUTION
ronrsnfld
Super User
Super User

You need to repeat the entire test  (Text.Contains)

and you need to connect the tests with an or , not an and

 

I also suggest you make the test case-insensitive

= Table.SelectRows(#"Exclude Blank and NA Notes", each 
                 Text.Contains([Notes], "No note from tutor", Comparer.OrdinalIgnoreCase) 
              or Text.Contains([Notes], "No notes from tutor",Comparer.OrdinalIgnoreCase))

 

You could also use the List.Contains method as suggested by @jgeddes  but, again, I would add the case insensitive option:

= Table.SelectRows(#"Exclude Blank and NA Notes", each 
            List.Contains({"No note from tutor","No notes from tutor"},
            [Notes],
            Comparer.OrdinalIgnoreCase))

View solution in original post

3 REPLIES 3
v-dineshya
Community Support
Community Support

Hi @Nephandi99 ,

If @ronrsnfld , @jgeddes  response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found that response helpful.

Thank you

ronrsnfld
Super User
Super User

You need to repeat the entire test  (Text.Contains)

and you need to connect the tests with an or , not an and

 

I also suggest you make the test case-insensitive

= Table.SelectRows(#"Exclude Blank and NA Notes", each 
                 Text.Contains([Notes], "No note from tutor", Comparer.OrdinalIgnoreCase) 
              or Text.Contains([Notes], "No notes from tutor",Comparer.OrdinalIgnoreCase))

 

You could also use the List.Contains method as suggested by @jgeddes  but, again, I would add the case insensitive option:

= Table.SelectRows(#"Exclude Blank and NA Notes", each 
            List.Contains({"No note from tutor","No notes from tutor"},
            [Notes],
            Comparer.OrdinalIgnoreCase))
jgeddes
Super User
Super User

When you use Text.Contains you need to restate the column reference. This should work...

Table.SelectRows(#"Exclude Blank and NA Notes", each Text.Contains([Notes], "No note from Tutor") and Text.Contains( [Notes], "No notes from Tutor"))

 You may also want to consider using List.Contains.

Table.SelectRows(#"Exclude Blank and NA Notes", each List.Contains({"No note from Tutor", "No notes from Tutor"}, [Notes]))




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors