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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
rsbin
Community Champion
Community Champion

Text Does Not Contain

Good Afternoon,

Haven't had to use Power Query in a while, but don't understand why I am unable to filter my column [Facility] correctly.

I want to include only those rows where the text "TSI" or "HUB" does not appear anywhere in the value.

Alternatively stated, exclude all rows where either of these two text strings exist.

Below is the last line of the Advanced Editor.

 

#"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each not Text.Contains([Facility], "TSI") or not Text.Contains([Facility], "HUB")
in
#"Filtered Rows"

 

Am I not using this function correctly?

All help is much appreciated!

Thanks and kind regards,

1 ACCEPTED SOLUTION
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

bracked missing after each. Since you are using one and condition, hence brackets are needed.

Use this

= Table.SelectRows(#"Renamed Columns", each (not Text.Contains([Facility],"HUB") and not Text.Contains([Facility],"TSI")))

Alternatively, you can use an OR condition with not outside'

= Table.SelectRows(#"Renamed Columns", each not (Text.Contains([Facility],"HUB") or  Text.Contains([Facility],"TSI")))

View solution in original post

3 REPLIES 3
WillJ731
New Member

A potentially easier way to exclude values from a row would be to use the M 'does not equal' operator ('<>'). I'd suggest something like this:

#"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each [Facility] <> "TSI" and [Facility] <> "HUB"
in
#"Filtered Rows"

 

Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

bracked missing after each. Since you are using one and condition, hence brackets are needed.

Use this

= Table.SelectRows(#"Renamed Columns", each (not Text.Contains([Facility],"HUB") and not Text.Contains([Facility],"TSI")))

Alternatively, you can use an OR condition with not outside'

= Table.SelectRows(#"Renamed Columns", each not (Text.Contains([Facility],"HUB") or  Text.Contains([Facility],"TSI")))

@Vijay_A_Verma ,

Thanks much for the Solution.

Best Regards,

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.