[英]Calculate a metric based on two tables in Power BI
Within my model I need to calculate a measure based on two related tables. 在我的模型中,我需要基于两个相关表来计算度量。 The schema would be something like this:
模式将是这样的:
On the table AI need to calculate a new metric called Bonus (Revenue*%bonus). AI在桌子上需要计算一个新的指标,称为奖金(收入*%奖金)。
I'm kind of new with this tool, and I have seen a possible solution but so sure to understand it properly. 我对这个工具有点陌生,我已经看到了可能的解决方案,但请务必正确理解。 What should I do, create the metric on the dashboard or in PowerBi?
我应该怎么做,在仪表板上或在PowerBi中创建指标?
I would appreciate any help. 我将不胜感激任何帮助。
Regards, 问候,
If you have a relationship between Table A and Table B on the Contract_type
column, then you can create the Bonus
calculated column simply as 如果在
Contract_type
列上的表A和表B之间存在关系,则可以简单地创建Bonus
计算列,如下所示:
Bonus = TableA[Revenue] * RELATED( TableB[%bonus] )
If you need this as a measure, then put it inside a SUMX
: 如果需要此措施,请将其放入
SUMX
:
Bonus = SUMX ( TableA, TableA[Revenue] * RELATED( TableB[%bonus] ) )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.