Reputation: 23
I am trying to calculate 'TimeSheet Team PV'[Time (h)] * 'Position History'[Salary]
Data model: TimeSheet Team PV" table: "Position History" table:
In the Position History table, I have some employees which were promoted and appear as having different periods during different periods in the company, with different salary. Can I join somehow these values based on Start Date, End Date (Position History table) and Work Date (TimeSheet Team PV tables) + Name?
I would like to generate new column in the TimeSheet Team PV table, with the calculation above.
Upvotes: 0
Views: 50
Reputation: 40204
You'll need to write some logic to make sure it uses the Work Date
column. Something like this:
Cost =
VAR WorkDate = 'TimeSheet Team PV'[Work Date]
RETURN
'TimeSheet Team PV'[Time (h)]
* CALCULATE (
SELECTEDVALUE ( 'Position History'[Salary] ),
'Position History'[Start Date] <= WorkDate,
'Position History'[End Date] >= WorkDate
)
Upvotes: 1