【发布时间】:2020-10-20 13:03:55
【问题描述】:
我是 DAX 新手。
我的模型包含一个名为 Notices 的表。通知有 235,969 行。
通知具有字段CustomerID、NoticeNo 和NoticeStatus。
当我将过滤上下文设置为'CANCL' Notices[NoticeStatus] 时,我可以看到有3 个通知具有CANCL 状态。
因此,下面的度量评估为 3,因为剩余的每个通知都属于 3 个单独的客户。但是,我想将聚合基于未过滤的表,但根据保留在过滤器上下文中的 CustomerID 和[ObCount] = 1 过滤掉行(聚合后)。在这种情况下,该度量需要评估为 0 或 BLANK(),因为在过滤 [ObCount] = 1 之后,过滤器上下文中的任何 CustomerID 都不会保留。
Customers with Single Notice Only =
COUNTROWS (
FILTER (
SUMMARIZECOLUMNS (
Notices[CustomerID],
Notices,
"ObCount", [All Notices Outstanding]
),
[ObCount] = 1
)
)
[All Notices Outstanding] = COUNTROWS(Notices)
【问题讨论】:
标签: powerbi dax powerbi-desktop