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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Time Period with stipulations

I am currently stuck, and I do not know how to even start to write a formula. I have a table that is like a tree. I have one day with three different times, which has a department for each time, which then has a shift for each time. Kind of like this,

DepartmentDate/TimeShiftData
Fork Lift1/19/2023 15:011st Shift
  2nd Shift
  3rd Shift
 1/19/2023 7:031st Shift
  2nd Shift()
  3rd Shift
 1/18/2023 23:011st Shift()
  2nd Shift()
  3rd Shift
 1/18/2023 15:011st Shift
  2nd Shift
  3rd Shift()
Press1/19/2023 15:011st Shift
  2nd Shift
  3rd Shift
 1/19/2023 7:031st Shift
  2nd Shift()
  3rd Shift
 1/18/2023 23:011st Shift()
  2nd Shift()
  3rd Shift
 1/18/2023 15:011st Shift
  2nd Shift
  3rd Shift()
Data

 I receive a report every 8 hours, 30 minutes after the previous shift. I will only have up to four dates/times because power query removes everything but my four newest reports. I need to show the three previous shifts for each department. However, the main problem is in the time the report is pulled. Because the information pulls 30 minutes after each shift, it shows incomplete data from the current shift the report was pulled. The report time cannot change because the supervisors need time to fix any problems. Also, the report only pulls by "today" (0:00 - 24:59), not the past 24 hours.


I need power bi to figure out the current shift and pull the data from a previous report. I have put a few cells in bold, and a few have parentheses at the end to try to clarify what I need. Every cell with parentheses will need to be used to pull data for the report's current shift. Every shift in bold is the current shift the report has pulled that need to use data from the previous shift.

Maybe I am just complicating things, but I cannot figure out how to make power bi do this for me. Can anyone help?

2 REPLIES 2
Anonymous
Not applicable

Good Afternoon @lbendlin ,

 

I hope you are having a blessed day so far. Here is a small sample of my data.

 

Date modifiedTransform File.Department NameTransform File.Shift NameTransform File.REG 7U01Transform File.OT 7U05 HoursTransform File.Double timeTransform File.Arrived EarlyTransform File.Arrived Early_1Transform File.Tardy
1/23/2023 7:01Assembly Fork Lift1st Shift0:000:000:0071:150
1/23/2023 7:01Assembly Fork Lift3rd Shift24:00:000:000:0030:360
1/23/2023 7:01Assembly Fork Lift1st Shift0:000:000:0071:150
1/23/2023 7:01Assembly Fork Lift3rd Shift20:1515:450:0041:180
1/21/2023 23:01Assembly Fork Lift1st Shift0:0062:00:000:0071:000
1/21/2023 23:01Assembly Fork Lift2nd Shift8:0017:300:0030:560
1/21/2023 23:01Assembly Fork Lift3rd Shift20:1523:450:0051:340
1/21/2023 15:01Assembly Fork Lift1st Shift0:0062:00:000:0071:000
1/21/2023 15:01Assembly Fork Lift2nd Shift0:000:000:0010:160
1/21/2023 15:01Assembly Fork Lift3rd Shift20:1515:450:0041:180
1/20/2023 23:01Assembly Fork Lift1st Shift19:1553:00:000:0067:100
1/20/2023 23:01Assembly Fork Lift2nd Shift16:000:000:0051:091
1/20/2023 23:01Assembly Fork Lift3rd Shift19:454:150:0040:560
1/20/2023 15:01Assembly Fork Lift1st Shift1:0027:15:000:0055:050
1/20/2023 15:01Assembly Fork Lift2nd Shift0:000:000:0041:050
1/20/2023 15:01Assembly Fork Lift3rd Shift19:454:150:0040:560

 

checked 1/21/2023 7:01

1/20/2023 15:01Assembly Fork Lift1st Shift1:0027:15:000:0055:050
1/20/2023 23:01Assembly Fork Lift2nd Shift16:000:000:0051:091
1/21/2023 7:01Assembly Fork Lift3rd Shift0:000:000:0000:000

 

checked: 1/21/2023 15:01

1/21/2023 15:01Assembly Fork Lift1st Shift0:0062:00:000:0071:000
1/20/2023 23:01Assembly Fork Lift2nd Shift16:000:000:0051:091
1/21/2023 7:01Assembly Fork Lift3rd Shift0:000:000:0000:000

 

Checked: 1/21/2023 23:01

1/21/2023 15:01Assembly Fork Lift1st Shift0:0062:00:000:0071:000
1/21/2023 23:01Assembly Fork Lift2nd Shift8:0017:300:0030:560
1/21/2023 7:01Assembly Fork Lift3rd Shift0:000:000:0000:000

 

Checked: 1/22/2023 7:01

1/21/2023 15:01Assembly Fork Lift1st Shift0:0062:00:000:0071:000
1/21/2023 23:01Assembly Fork Lift2nd Shift8:0017:300:0030:560
1/22/2023 7:01Assembly Fork Lift3rd Shift0:000:000:0000:000

 

Checked: 1/22/2023 15:01

 

1/21/2023 15:01Assembly Fork Lift1st Shift0:000:000:0000:000
1/21/2023 23:01Assembly Fork Lift2nd Shift8:0017:300:0030:560
1/22/2023 7:01Assembly Fork Lift3rd Shift0:000:000:0000:000

 

Checked: 1/22/2023 23:01

1/21/2023 15:01Assembly Fork Lift1st Shift0:000:000:0000:000
1/21/2023 23:01Assembly Fork Lift2nd Shift0:000:000:0000:000
1/22/2023 7:01Assembly Fork Lift3rd Shift0:000:000:0000:000

 

Checked: 1/23/2023 7:01

1/21/2023 15:01Assembly Fork Lift1st Shift0:000:000:0000:000
1/21/2023 23:01Assembly Fork Lift2nd Shift0:000:000:0000:000
1/23/2023 7:01Assembly Fork Lift3rd Shift24:00:000:000:0030:360

 

 

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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