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
mduf
New Member

How to best filter rows of a table based on multiple strings

Hello BI community,

 

Trying to learn Power BI the hard way but I can't figure it out by myself. Is there a better way to filter rows from a table based on multiple string values? A bit as we would do in SQL with NOT IN ('aaa', 'bbb', 'ccc')? The red lines below are the ones I would like to optimize.

____________________________

let
Source = Sql.Databases("MYSERVER"),
CM_PKD = Source{[Name = "CM_ABC"]}[Data],
dbo_v_GS_CCM_RECENTLY_USED_APPS = CM_ABC
{[Schema = "dbo", Item = "v_GS_CCM_RECENTLY_USED_APPS"]}
[Data],
#"Removed Columns" = Table.RemoveColumns(
dbo_v_GS_CCM_RECENTLY_USED_APPS,
{
"msiVersion0",
"ProductCode0",
"ProductLanguage0",
"SoftwarePropertiesHash0"
}
),
#"Removed Other Columns" = Table.SelectColumns(
#"Removed Columns",
{"ResourceID", "ExplorerFileName0", "LastUsedTime0", "ProductName0", "ProductVersion0"}
),
#"Filtered Rows" = Table.SelectRows(
#"Removed Other Columns",
each not Text.Contains([ExplorerFileName0], "bomgar-scc-")
and not Text.Contains([ExplorerFileName0], "DisplayLinkTrayApp.exe")
and not Text.Contains([ExplorerFileName0], "FileCoAuth.exe")
and not Text.Contains([ExplorerFileName0], "FileSyncConfig.exe")
and not Text.Contains([ExplorerFileName0], "identity_helper.exe")
and not Text.Contains([ExplorerFileName0], "ie4uinit.exe") //my list has 40 more items...
)
in
#"Filtered Rows"

____________________

Thank you in advance,

 

MDuf

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Nothing wrong with that code. If you want to "optimize" it then fold it up into the SQL. (That may be happening anyway)

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