Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello guys,
Is there any way that I can sum amount of time with dax in hh:mm:ss format? I want to keep track of the amount of time my employees are in lunch, break, or something like that.
For examples
Employee // Task // Start time// End time // Duration
Louis // Lunch // 11:03:15 am // 12: 13: 26 pm // 01:10:11
And being able to sum how much time he spents on lunch per week? Assuming the lunch time per day is just 1h.
Id like a measure that can show me the results in hh:mm:ss format and i havent found ANYTHING online either youtube 😞
Thanks
Solved! Go to Solution.
Hi,
Could you please check the below link to the pbix i have created:
https://1drv.ms/u/s!AikPceQOhqFEhBXLUf0tmuSOsk4l?e=AaLqgy
I have added a calculated column to calculate the difference between starttime and endtime:
Lunch Per Day = PATHITEM(SUBSTITUTE(FORMAT( 'Table'[EndTime] - 'Table'[StartTime], "DD-MM-YYYY HH:MM:SS" )," ", "|"), 2 )
Also, added another column to display 'Start of Week' so that we can check the lunch hours on a weekly basis.
Then, i have created a measure to sum the time difference:
Weekly Lunch break sum = VAR v_WeeklySum = CALCULATE( SUM( 'Table'[Lunch Per Day] ), ALLEXCEPT( 'Table', 'Table'[Start of Week], 'Table'[Ename] ), FILTER( 'Table', 'Table'[Task] = "Lunch" ) ) RETURN PATHITEM( SUBSTITUTE(FORMAT( v_WeeklySum, "DD-MM-YYYY HH:MM:SS" )," ", "|"), 2 )
This gives me below result:
Thanks.
Please accept this as a solution if it satisfies the requirement. Appreciate your Kudos. 🙂
Hi,
Could you please check the below link to the pbix i have created:
https://1drv.ms/u/s!AikPceQOhqFEhBXLUf0tmuSOsk4l?e=AaLqgy
I have added a calculated column to calculate the difference between starttime and endtime:
Lunch Per Day = PATHITEM(SUBSTITUTE(FORMAT( 'Table'[EndTime] - 'Table'[StartTime], "DD-MM-YYYY HH:MM:SS" )," ", "|"), 2 )
Also, added another column to display 'Start of Week' so that we can check the lunch hours on a weekly basis.
Then, i have created a measure to sum the time difference:
Weekly Lunch break sum = VAR v_WeeklySum = CALCULATE( SUM( 'Table'[Lunch Per Day] ), ALLEXCEPT( 'Table', 'Table'[Start of Week], 'Table'[Ename] ), FILTER( 'Table', 'Table'[Task] = "Lunch" ) ) RETURN PATHITEM( SUBSTITUTE(FORMAT( v_WeeklySum, "DD-MM-YYYY HH:MM:SS" )," ", "|"), 2 )
This gives me below result:
Thanks.
Please accept this as a solution if it satisfies the requirement. Appreciate your Kudos. 🙂
@Anonymous Hey, thanks so much for your response, actually it helped me a lot, im still kind of consufed about the process of getting the result haha i just still have a doubt, using the same result, on the 1st week the total lunch time is 2:20:27, what if the max lunch time per week is just 2:00:00, how can I calculate the difference between both? So i can know which employee is spending more time in lunch than the others
Thanks
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
84 | |
66 | |
62 | |
60 |
User | Count |
---|---|
197 | |
118 | |
108 | |
78 | |
69 |