Forum Discussion
Yggdrasill
4 years agoResponsive Resident
Find value between two tables and dates
Maybe it's because it's monday or something but I just can't get my head around a what I thought was a simple stuff but here I am, few hours later... Problem: I have two tables with no active r...
sevenhills
4 years agoSuper User
Please can you provide what is expected output in your top scenario (like a mockup)
Tough to visualize sometimes ...
Yggdrasill
4 years agoResponsive Resident
The expected output is to find hourly rate and multiply that number with the amount of hours worked. That should define the cost. However I need to be able to look at cost regardless of if I'm looking at one employee, two or all.
Come to think of it maybe it's easier to let PQ calculate the cost in the fact table? So everytime an hour is registered another column is calculated for the cost behind that hour
- sevenhills4 years agoSuper User
- DAX I provided the measure is from your original post and based on a date.
- What you are asking is SCD2 - Fact type of example.
- Let me explain, in case you have not noted already as this type.
- You have two tables
- One table is fact i.e., containing transactions. in your case, employee worked hours on each date.
- Second table is SCD i.e., Slowly change dimension. Where you have effective start date and rate for each employee. (and you are missing is effective end date, which is not an issue).
- What you are looking is to get the rate based on the transaction date!
- You can take a look at these examples and fit to your needs.
If my analysis of your problem is wrong, then I need more details.
Optionally, you can take a look