dax检查一个值是否匹配另一个表的值

发布于 2025-02-04 06:11:44 字数 1233 浏览 2 评论 0原文

在PowerBi台式机中,我有两个不同的表,其中包含不同的数据,可以共享1列。表包含有关产品的信息,每个表都有一个名为“ SKU ID”的列。我想创建一个量度,以计算来自其他表格中有多少产品具有匹配的SKU ID。我希望这是有道理的。以下是我的表:

“表1” ”表2“

所以我只想要一个措施来计算多少个产品名称具有与卡车路线相匹配的SKU ID。我被困了好几天了!谢谢大家!

更新 文本格式的表格如下:

Product Name    |    SKU ID
------------------------------
Toy                  182772
Boat                 294773
Car                  928844
Cup                  277453
Plate                933111
Chair                182772
Table                182772
Remote               277453
Fork                 933111


Truck Route  |  SKU ID
--------------------------
MEM1              182772
SDF3              294773
DTW1              928844
SAN8              277453
MIA8              933111
MIA8              182772
SAN8              182772
MEM1              277453
SDF3              933111

**我正在寻找一个结果,如果您单击MEM1-3的PowerBi中的表桌子。

In PowerBi desktop I have two different tables with different data that share 1 column. The tables contain information about products and each table has a column titled "SKU ID". I want to create a measure that counts how many products have a matching SKU ID from a different table. I hope that makes sense. Below are my tables:

Table 1Table 2

So I just want a measure that counts how many Product Names have a SKU ID that matches a Truck Route with the same SKU ID. I've been stuck for days! Thank you all in advance!

UPDATE
Tables in text format are as follows:

Product Name    |    SKU ID
------------------------------
Toy                  182772
Boat                 294773
Car                  928844
Cup                  277453
Plate                933111
Chair                182772
Table                182772
Remote               277453
Fork                 933111


Truck Route  |  SKU ID
--------------------------
MEM1              182772
SDF3              294773
DTW1              928844
SAN8              277453
MIA8              933111
MIA8              182772
SAN8              182772
MEM1              277453
SDF3              933111

** I am looking for a result where if you click on the table in PowerBi on route MEM1 - 3. So when you click on MEM1, the count of matching SKU IDs is returned from the Product name table.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

肤浅与狂妄 2025-02-11 06:11:44

您的数据对我来说看起来很不寻常,因此很难确切地知道输出的外观。通常,您会使用关系在PBI中实现这一目标,但是正如我所说,您的数据很难理解而没有更多背景。是您想要的以下内容:

”在此处输入图像说明”

如果是这样,请添加表格并添加卡车路由和SKU ID字段,以确保它们设置为不总结。

添加一个度量如下:

Measure = COUNTROWS(FILTER(Products, Products[SKU ID] = SELECTEDVALUE('Truck Routes'[SKU ID])))

将措施拖入表中为第三列。

Your data looks very unusual to me so it is hard to know precisely what the output should look like. Normally, you would achieve this in PBI using relationships but as I said your data is hard to understand without more context. Is the following what you want:

enter image description here

If so, add a table and add the truck route and SKU ID fields making sure they're set to Don't Summarise.

enter image description here

Add a measure as follows:

Measure = COUNTROWS(FILTER(Products, Products[SKU ID] = SELECTEDVALUE('Truck Routes'[SKU ID])))

Drag the measure into the table as the 3rd column.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文