PowerBI-根据多列中的值计算行数

厌倦编程

PowerBi Desktop v 2.64.5285.741 64位(2018年11月)

你好,

假设我有一个名为WorkReport的表

在此处输入图片说明

在PowerBi Desktop中,用于查找包含Status = 'Not Started'的行数的正确DAX语法是Progress = "slow"什么?

下面,我将提供一个我尝试失败的查询列表:

report = CALCULATE(COUNTAX(WorkReport,WorkReport[Status]), WorkReport[Status] = "Not Started") && WorkReport[progress]WorkReport[progress], WorkReport[progress] = "slow")

report = CALCULATE(COUNT(WorkReport,WorkReport[Status]), WorkReport[Status] = "Not Started") && WorkReport[progress]WorkReport[progress], WorkReport[progress] = "slow")

report = CALCULATE(COUNTAX(WorkReport,WorkReport[Status]), WorkReport[Status] = "Not Started") AND WorkReport[progress]WorkReport[progress], WorkReport[progress] = "slow")

report = CALCULATE(COUNT(WorkReport,WorkReport[Status]), WorkReport[Status] = "Not Started") AND WorkReport[progress]WorkReport[progress], WorkReport[progress] = "slow")

report = COUNTROWS(FILTER(WorkReport,WorkReport[Status]="NotStarted") AND (WorkReport, WorkReport[progress] = "slow"))

report = COUNTROWS(FILTER(WorkReport,WorkReport[Status]="NotStarted") && (WorkReport, WorkReport[progress] = "slow"))

在此处输入图片说明 在此处输入图片说明

请告知您是否能够在PowerBI Desktop工具中实现此目的。谢谢!

奥莉

度量本身很简单COUNTROWS,但是您需要使用所需CALCULATE的过滤器来过渡上下文:

MyMeasure = 
    CALCULATE ( 
        COUNTROWS ( WorkReport ),
        WorkReport[Status] = "Not Started",
        WorkReport[Progress] = "slow"
    )

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章