gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 03:25:10 29 4
gpt4 key购买 nike

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

你好,

假设我有一个名为 WorkReport

的表

enter image description here

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

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

report = CALCULATE(COUNTAX(WorkReport,WorkReport[Status]),
WorkReport[Status] = "未开始") &&
WorkReport[进度]WorkReport[进度], WorkReport[进度] =
“慢”)

report = CALCULATE(COUNT(WorkReport,WorkReport[Status]),
WorkReport[Status] = "未开始") &&
WorkReport[进度]WorkReport[进度], WorkReport[进度] =
“慢”)

report = CALCULATE(COUNTAX(WorkReport,WorkReport[Status]),
工作报告[状态] =“未开始”)和
WorkReport[进度]WorkReport[进度], WorkReport[进度] =
“慢”)

report = CALCULATE(COUNT(WorkReport,WorkReport[Status]),
工作报告[状态] =“未开始”)和
WorkReport[进度]WorkReport[进度], WorkReport[进度] =
“慢”)

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

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

enter image description here enter image description here

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

最佳答案

度量本身是一个简单的COUNTROWS,但您需要使用CALCULATE 来转换上下文,应用您想要的过滤器:

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

关于function - PowerBI - 根据多列中的值计算行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53637662/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com