使用一对多关系进行求和乘积的测量

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

Measure for sumproduct with a many to one relationship

问题

Table 1:

使用一对多关系进行求和乘积的测量

Table 2:

使用一对多关系进行求和乘积的测量

我需要一个度量,将执行SUM(每个Value2 * 相应的Value1)

我尝试了以下方法,但它不起作用 - 我认为是因为表的行数不同。

度量 = SUMX(Table2, Table2[Value2] * Table1[Value1])
英文:

Table 1:

使用一对多关系进行求和乘积的测量

Table 2:

使用一对多关系进行求和乘积的测量

I need a measure that will do SUM( every Value2* corresponding Value1)

I have tried the following but it does not work - I assume due to the tables being different number of rows.

Measure = SUMX(Table2, Table2[Value2] * Table1[Value1])

答案1

得分: 1

使用这个度量值来获得以下结果:

使用一对多关系进行求和乘积的测量

英文:

Assuming you have a relationship like this

使用一对多关系进行求和乘积的测量

use this measure

Measure = 
SUMX(
    Table2, 
    Table2[Value2] * RELATED(Table1[Value1])
)

to get this result:

使用一对多关系进行求和乘积的测量

huangapple
  • 本文由 发表于 2023年2月8日 20:11:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75385615.html
匿名

发表评论

匿名网友

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

确定