如何在Power BI中获取度量值的总和

huangapple go评论146阅读模式
英文:

How to get Sum of Measure value in Power BI

问题

了解您想要获得 Power BI 中度量的总和。我已经搜索并尝试了不同的方法整整一天,但仍然无法解决。

下面的表格显示了我的度量,Resources divided by Count of Date 3,它等于每天的资源数量 =

DIVIDE(
	SUM('table'[Resource]),
	DISTINCTCOUNT('table'[Date])
)

然而,现在我想获得这个度量的总和,即获取所选周的资源总和,但它显示不正确:

如何在Power BI中获取度量值的总和

总值应该显示为 60.11 而不是 53.25

英文:

was wondering if anyone knows how I can get the sum of a measure in Power BI. I have googled and tried different methods the entire day but it still doesn't work.

The table below shows my Measure, Resources divided by Count of Date 3, which equates to the number of resources per day =

DIVIDE(
	SUM('table'[Resource]),
	DISTINCTCOUNT('table'[Date])
)

However, now i want to get the sum of this measure i.e. get the sum of resources for the selected week but its not showing up correctly:

如何在Power BI中获取度量值的总和

The total value should show up as 60.11 instead of 53.25.

答案1

得分: 3

需要将此转化为迭代测量:

加法测量 =
SUMX (
    VALUES ( 'table'[Parent_Project_Type] ), 
    [您现有的测量]
)

或者使用您的新表名信息:

SUMX (
    VALUES ( as_mapops_resource_management[Parent_Project_Type] ), 
    [资源日期水平] // 注意:这是一个测量引用
)
英文:

You need to make this into an iterative measure:

Additive Measure =
SUMX (
    VALUES ( 'table'[Parent_Project_Type] ), 
    [Your existing measure]
)

OR with your new table name information:

SUMX (
    VALUES ( as_mapops_resource_management[Parent_Project_Type] ), 
    [resource date level] // Note: this is a measure reference
)

答案2

得分: 0

我成功找到了另一种解决方案,与Marcus分享的不同。还注意到最终值应为69.45,而不是上面提到的60.11。在手动计算时漏掉了一个类别。

我在这里发布我的解决方案,供需要的任何人使用:

Additive Measure = 
SUMX( SUMMARIZE(table, table[Parent_Project_Type]), [resource date level])

如何在Power BI中获取度量值的总和

英文:

I managed to figure out another solution alternative to what Marcus shared. Also noted the final value should be 69.45 instead of 60.11 as stated above. Missed out one category when doing manual calculation..

Posting my solution here for anyone who needs it:

Additive Measure = 
SUMX( SUMMARIZE(table, table[Parent_Project_Type]), [resource date level])

如何在Power BI中获取度量值的总和

huangapple
  • 本文由 发表于 2023年2月23日 22:32:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75546233.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定