The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Hi,
Share data in a format that can be pasted in an MS Excel file and show the expected result.
Nothing wrong with that code. If you want to "optimize" it then fold it up into the SQL. (That may be happening anyway)