Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powerbi DAX中的二次域滤波_Powerbi_Dax_Powerbi Desktop - Fatal编程技术网

Powerbi 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

我是DAX的新手

我的模型包含一个名为
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可删除筛选器状态筛选器。

有效。我仍然在努力理解计算函数。