Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
MatthijsOFG
Regular Visitor

total real production time based on starttime and endtime

Hello!

I have production data like this: 

MatthijsOFG_0-1686070419596.png

How would you calculate using dax or mcode the total real time that production was running on a certain day? So in this case, 13:42:56 - 05:30:00 - gaps in production. The gaps make it hard, because I can't just simply do (maxtime of the day - mintime of the day) using ALLEXCEPT function. 


I appreciate the help ! 🙂

2 REPLIES 2
MatthijsOFG
Regular Visitor

@amitchandak 

Thank you for helping!

Because I want to know the time that total production was active. 

For example if on a certain day there are 10 production lines. The 10 production lines are all running simultaneously from 06:00 tot 07:00. I would have 10 rows of data. Your measure would answer 10 hours. But the answer I want to get out of the measure would be 1 hour. 

amitchandak
Super User
Super User

@MatthijsOFG , why do not you just take diff in column

Production Duration = [End Time] - [Start Time]

 

or have a measure like

 

Production Sec sum= Sumx( Table, datediff( [Start Time],[End Time] , second) )

 

and then covert to time

a new measure = time(0,0,0) + [Production Sec sum]/(3600*24)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.