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
blynn
Helper I
Helper I

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

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

View solution in original post

3 REPLIES 3
simst0
Regular Visitor

How were you able to fix.  I am trying to to the same thing currently. 

v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

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

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.