Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone,
I have a static table with EmployeeID and their hours per week, which is based on their contract. Every employee's hours are registrered per day. I want to be able to compare the hours per week and their actual hours they've worked. And not only per week, but also per month or year. So the static table have to become more dynamic. Is this possible?
Solved! Go to Solution.
@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.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hi @Anonymous ,
In general,
If you want some particular measure, then, please, provide:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1 to 2.
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
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.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |