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
Anonymous
Not applicable

How do I Split time into shifts when it starts on previous date

How would I split/define the following work shifts

Example for Work Date - June 30, 2018

Shift times

  • 3rd; June 29, 2018 @  23:00:00 to June 30, 2018 @  06:59:59
  • 1st; June 30, 2018 @  07:00:00 to June 30, 2018 @  14:59:59
  • 2nd; June 30, 2018 @  15:00:00 to June 30, 2018 @  22:59:59

3rd shift is first

5 REPLIES 5
RedBoxJJKW
New Member

A solution can be found here:

Groups Days and Create Shifts Column 

Anonymous
Not applicable

Did you every figure this out? I am having the same issue with a shift ending at 1AM and it is taking the start of the previous day.

v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Is this close to your goal?

2.png

3rd1 = CONCATENATE(CONCATENATE([date]-1,"@"),TIME(23,0,0))
3rd2 = CONCATENATE(CONCATENATE([date],"@"),TIME(6,59,59))
1st1 = CONCATENATE(CONCATENATE([date],"@"),TIME(7,00,00))
1st2 = CONCATENATE(CONCATENATE([date],"@"),TIME(14,59,59))
2nd1 = CONCATENATE(CONCATENATE([date],"@"),TIME(15,00,00))
2nd2 = CONCATENATE(CONCATENATE([date],"@"),TIME(22,59,59))

Best Regards

Maggie

Anonymous
Not applicable

Sort of, however, I am trying to use that data to filter to a shift. 

 

Ex. a problems occured @

8/16/2018 11:15pm (which is our 8/17/18)

8/17/2018 02:00 am

8/17/2018 11:20pm

 

When filtered by day or shift the firse and second items should be 8/17/18 3rd shift and the third should be 8/18/18 3rd shift

Greg_Deckler
Super User
Super User

Very difficult to say specifically without sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

That being said, the HOUR function returns a number between 0 and 23 so that's probably your best bet.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.