cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
blynn
Frequent Visitor

Calculating downtime for shifts when downtime crosses shifts

We have 4 crews(A,B,C,D), that work rotating 12 hr shifts and they are 6:00 to 18:00 and 18:00 to 6:00. We capture downtime in a table with a starttime and an endtime. We have a slicer that sets a start date of say 4/29 6:00 and end date of 5/6 6:00. We have a table with the shift schedule, where there are 2 rows for each day, like 04/29/18 6:00 and 4/29/18 18:00 with the shift letter.

 

Each shift's downtime is the time down in their shift, while the total downtime for that segment could span mutliple shifts and be outside the slicer limits. I'm looking for a way to get a breakdown of each shifts downtime and sum that downtime up for a total. I'm using Directquery now, but if its impossible I can switch to import. I wasn't sure how to start to set the relationships and what measures to create. I had something working between the slicers with IF statements but I had to switch to Import before it would work. However, this didn't address breaking it down by shifts. I'm more of a SQL person than a DAX person so it something needs to be prepared on the SQL side, I can do that.

 

I can capture screen shots of the data is thats helpful.

 

Any help would be appreciated!

Bart

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
blynn
Frequent Visitor

Re: Calculating downtime for shifts when downtime crosses shifts

I spent some time and I ended up  figuring it out on my own.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: Calculating downtime for shifts when downtime crosses shifts

HI @blynn,

 

Please provide some sample data or pbix file to help us clarify your scenario and coding formula.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
blynn
Frequent Visitor

Re: Calculating downtime for shifts when downtime crosses shifts

I spent some time and I ended up  figuring it out on my own.

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors