Forum Discussion
Connect a static table with a dynamic table
- 4 years ago
Anonymous ,
I've used 3 measures to get your result:
H_worked = SUM ( 'T-fact'[Hours worked] )Hours_per_week = VAR _t = ADDCOLUMNS ( SUMMARIZE ( 'T-fact', 'T-fact'[EmployeeID], 'Date'[Week of Year] ), "@H/week", VAR currentEmpID = CALCULATE ( SELECTEDVALUE ( 'T-fact'[EmployeeID] ) ) RETURN CALCULATE ( SUM ( 'T-contract'[Hours per week] ), 'T-contract'[EmployeeID] = currentEmpID ) ) RETURN SUMX ( _t, [@H/week] )Utilisation Rate = DIVIDE ( [H_worked], [Hours_per_week] )If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
Hi ERD ,
It would be great if you could provide me the measure. I created a sample set. You can find the link here:
I added a date table by using the query in this link:
https://forum.enterprisedna.co/t/extended-date-table-power-query-m-function/6390
I hope it's possible to compare the Hours per week in 'employeeID' with Hours worked in 'sample'. I added a sheet, named 'result'. I hope this helps. If you have any question, please let me know.
I also tried the following measure:
Anonymous ,
I've used 3 measures to get your result:
H_worked = SUM ( 'T-fact'[Hours worked] )Hours_per_week =
VAR _t =
ADDCOLUMNS (
SUMMARIZE ( 'T-fact', 'T-fact'[EmployeeID], 'Date'[Week of Year] ),
"@H/week",
VAR currentEmpID = CALCULATE ( SELECTEDVALUE ( 'T-fact'[EmployeeID] ) )
RETURN
CALCULATE (
SUM ( 'T-contract'[Hours per week] ),
'T-contract'[EmployeeID] = currentEmpID
)
)
RETURN
SUMX ( _t, [@H/week] )Utilisation Rate = DIVIDE ( [H_worked], [Hours_per_week] )If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
ERD , works like a charm!! Thank you so much.