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.
Hi PowerBI friends!
I'm calculating overtime which is calculated daily over 8hours and weekly over 40 hours. (Regular daily/weekly :7,5 and 37,5)
I have a matrix with a few columns:
employee number;employee name; transdate; hours worked,department, Daily>8
The daily>8 is a measure
So far all looks good and the problem starts here 😒
I need another column that shows a calculation of weekly hours over 40
I've tried this measure, have added a calendar table but can't get it to work.
I would appreciate any assistance.
Thank you
Solved! Go to Solution.
Could you provide a sample pbix after deleting sensitive data for us to do more tests
I came across this post by Alberto Ferrari
Obtaining accurate totals in DAX - SQLBI
This solved my issue.
Thanks Alberto and thanks to others that responded
Could you provide a sample pbix after deleting sensitive data for us to do more tests
I came across this post by Alberto Ferrari
Obtaining accurate totals in DAX - SQLBI
This solved my issue.
Thanks Alberto and thanks to others that responded
Hi Gabriel, I've edited the 2nd. measure to fix the error I've made when writting the post and to add the weeknum instead of date. I should say that the result of the measure is zero, like it is not considering the "grouping" by week.
This one is proven to be a complicated. Perhaps, this is not possible.
Thank you for your response.
Looks like a game of "spot the differences". Your latter measure is missing the first two rows of the first measure, and one comma from the middle.
I must say I've never used summarize before. For the first case, I'd just create a new dax or power query column, ie. a dax version:
overtime = max( [TotalHrs]-8, 0 )
and pull that to my visual where a daily overtime sum is needed.
Not sure how I'd make the latter though.
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 |
---|---|
105 | |
97 | |
80 | |
67 | |
63 |
User | Count |
---|---|
146 | |
110 | |
107 | |
86 | |
63 |