我有一张大型设备和第二个搜索词表。我想过滤设备列或组列中搜索的设备列表。我不确定PQ是否可以喜欢类似于SQL的加入,或者最好在DAX或M中进行此操作,无论如何我都是新手。我发现了一些在线示例,声称要做类似于我想要的事情,但是M代码令人困惑,根据帖子上的许多其他人,他们对解决方案的描述也没有意义。
谁能给我一些建议。我不确定在PQ中的性能会怎样。执行SQL查询会更好,但目前不是一个选择。
提前致谢。
例如:如果搜索列表由(“服务器”,“加载”,“ UK”)组成IE(“%服务器%”,“%load%”,“%uk%”)
搜索列表(命名范围 - 未固定的条目,可能为空): -
设备表(100K+行): -
行 |
设备 |
组 |
1 |
EP1-UK |
NULL |
2 |
UKG545DEV |
SERVER |
3 3 |
L123 |
负载平衡器 |
4 |
L678 |
负载平衡器 |
5 |
cak.co.uk |
站点 |
6 |
GBPRD996 |
备份 |
7 |
bltstlol |
draas |
8 |
232.156 |
foo-uk- |
9 |
server |
wack |
4 7删除): -
行 |
设备 |
组 |
1 |
ep1-uk |
null |
2 |
UKG545DEV |
Server3 |
3 |
L123 |
负载平衡器 |
4 |
L678 |
负载平衡器 |
5 |
cak.co.uk |
站点 |
8 |
232.156 |
foo-uk-wack-wack |
9 |
server4 |
感到无聊 |
。希望很简单。
I have a large table of devices and a second tiny table of search terms. I would like to filter the list of devices searching as a substring in the Device column or the Group column. I'm not sure if PQ can do Like Joins similar to SQL or if it is better to do this in DAX or M both of which I'm new to anyway. I've found a couple of online examples claiming to do something similar to what I want, but the M code was confusing and their descriptions on the solutions didn't make sense according to many others on the posts.
Can anyone give me some advice. I'm not sure what the performance will be like to do this in PQ. Executing a SQL query would be better, but isn't an option at present.
Thanks in advance.
E.g.: If the Search list is made up of ("server", "load", "uk") then I want to filter the Devices table on either the Device or Group columns looking for any row that contains them as case insensitive substrings, i.e. ("%server%", "%load%", "%uk%")
Search list (named range - not fixed number of entries, might be empty): -
Devices table (100k+ rows): -
Row |
Device |
Group |
1 |
EP1-uk |
null |
2 |
UKG545DEV |
Server3 |
3 |
L123 |
Load Balancer |
4 |
L678 |
Load Balancer |
5 |
cak.co.uk |
Site |
6 |
GBPRD996 |
Backup |
7 |
BLTSTLOL |
DRaaS |
8 |
232.156 |
Foo-UK-WACK |
9 |
Server4 |
Got bored |
Filtered Devices table (rows 6 and 7 removed): -
Row |
Device |
Group |
1 |
EP1-uk |
null |
2 |
UKG545DEV |
Server3 |
3 |
L123 |
Load Balancer |
4 |
L678 |
Load Balancer |
5 |
cak.co.uk |
Site |
8 |
232.156 |
Foo-UK-WACK |
9 |
Server4 |
Got bored |
That's it. Hopefully simple.
发布评论
评论(4)
是的,PQ支持加入。
的另一个示例:
这是加入您的参考 “灵活”匹配:
https://community.power.power.power.power.com.com/t5/desktop/合并WITH-WILDCARD/MP/581823
Yes, PQ supports joins.
This is another example for joining for your reference:
Excel MERGE two tables
For more “flexible” match:
https://community.powerbi.com/t5/Desktop/Merge-with-wildcards/m-p/581823
PQ具有模糊的加入,这可能是您想要的。
您可以选择手工制作自己的”喜欢“如果您真的需要加入。如果您发布示例数据和所需的输出,则有人会发布解决方案。
PQ has a fuzzy join which might be what you're looking for. https://support.microsoft.com/en-us/office/create-a-fuzzy-match-power-query-ffdd5082-c0c8-4c8e-a794-bd3962b90649
Alternatively, you can hand craft your own "like" join if you really need to. If you post sample data and desired output, someone will post a solution.
不知道这是多么有效,但是这将搜索所有列以查看它们是否包含查找列表中的任何文本,忽略了案例。然后,只需
通过(a)将行上的所有列组合到一个长文本(b)中来过滤该列的工作(c)(c)使用text.contains来转换搜索列表以找到匹配
No idea how efficient this is, but this will search all columns to see if any of them contain any text from your lookup list, case ignored. Then just filter that column
Works by (a) combining all columns on the row into one long text (b) bringing in the search list (c) transforming the search list using Text.Contains to find a match
如果您在SQL中执行此操作,则可以按照以下方式进行操作。您没有在这里加入。这是简单的过滤。
回复:性能 - 取决于您想做什么?是数据级还是分析级别?如果以后,则肯定会达克斯。如果事先,并且如果您有一个高级工作区,则将数据带到
datamart
,并且可以在此处应用完全合格的SQL。通常,DAX的性能比PQ出色。与SQL/DAX相同的方式,PQ无法扩展大数据。可以在DAX查询中复制
或更好地通过措施
rel =“ nofollow noreferrer”>

If you do this in SQL you would do it the following way. You are not doing any join here. It is simple filtering.
Re: Performance - Depends on what you want to do? Is the is data-level or analysis-level? If later, then surely DAX. If prior and if you have a premium workspace take your data to
datamart
and you can apply fully qualified SQL there. In general, DAX has a much superior performance than PQ. PQ is not scalable with large data the same way SQL/DAX is.The same can be replicated in a Dax Query
or better through a measure
ALL at once