Powerbi DAX中的二次域滤波
我是DAX的新手 我的模型包含一个名为Powerbi DAX中的二次域滤波,powerbi,dax,powerbi-desktop,Powerbi,Dax,Powerbi Desktop,我是DAX的新手 我的模型包含一个名为Notices的表。通知有235969行 通知有CustomerID、NoticeNo和NoticeStatus字段 当我将过滤器上下文设置为'CANCL'通知[NoticeStatus]时,我可以看到有3个通知的状态为CANCL 因此,下面的度量值为3,因为剩余的每个通知都属于3个独立的客户。但是,我希望将聚合基于未筛选的表,但根据保留在筛选上下文中且[ObCount]=1的CustomerID筛选出行(聚合后)。在这种情况下,度量值需要计算为0或BLAN
Notices
的表。通知有235969行
通知有CustomerID
、NoticeNo
和NoticeStatus
字段
当我将过滤器上下文设置为'CANCL'通知[NoticeStatus]
时,我可以看到有3个通知的状态为CANCL
因此,下面的度量值为3,因为剩余的每个通知都属于3个独立的客户。但是,我希望将聚合基于未筛选的表,但根据保留在筛选上下文中且[ObCount]=1
的CustomerID筛选出行(聚合后)。在这种情况下,度量值需要计算为0或BLANK()
,因为在过滤[ObCount]=1
后,过滤器上下文中的CustomerID都不会保留
Customers with Single Notice Only =
COUNTROWS (
FILTER (
SUMMARIZECOLUMNS (
Notices[CustomerID],
Notices,
"ObCount", [All Notices Outstanding]
),
[ObCount] = 1
)
)
[所有未完成通知]=COUNTROWS(通知)
您应该能够通过使用计算将筛选后的表作为表筛选参数应用于通知来完成此操作:
Customers with Single Notice Only =
CALCULATE (
COUNTROWS ( Notices ),
FILTER (
SUMMARIZECOLUMNS (
Notices[CustomerID],
ALL ( Notices ),
"ObCount", [All Notices Outstanding]
),
[ObCount] = 1
)
)
请注意,汇总时使用ALL可删除筛选器状态筛选器。有效。我仍然在努力理解计算函数。