d2907
d2907

Reputation: 902

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:

enter image description here

enter image description here

On the table A I need to calculate a new metric called Bonus (Revenue*%bonus).

enter image description here

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?

I would appreciate any help.

Regards,

Upvotes: 2

Views: 10772

Answers (1)

Alexis Olson
Alexis Olson

Reputation: 40204

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

Bonus = TableA[Revenue] * RELATED( TableB[%bonus] )

If you need this as a measure, then put it inside a SUMX:

Bonus = SUMX ( TableA, TableA[Revenue] * RELATED( TableB[%bonus] ) )

Upvotes: 5

Related Questions