The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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)
User | Count |
---|---|
77 | |
75 | |
36 | |
31 | |
29 |
User | Count |
---|---|
94 | |
80 | |
55 | |
48 | |
48 |