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

Morning, Noon and Night shift

I have datetime column that start from 01-01-2022 07:30:00 and end at 03-01-2022 23:59:59

 

I want to split days into Morning, Noon and Night shift

 

Morning => 07:00:00 - 15:00:00

Noon => 15:00:00 - 23:00:00

Night =>  23:00:00 - 07:00:00

( Night shift falls 7 hours in the next day)

 

In de powerbi file I show how I split days. I also created a date picker with the Before date en made a measure for the visual to filter the day chosen in the date picker.

 

The problem I couldn't solve is that Night shift falls 7 hours out of the chosen day So when I choose day 01-01-2022 and select Night shift I want to see the following results in the visual :

 

Values between 01-01-2022 23:00:00 and 02-01-2022 07:00:00

 

What powerbi gives back is :

 

Values between 01-01-2022 00:00:00 and 01-01-2022 07:00:00 &

values between 01-01-2022 23:00:00 and 01-01-2022 00:00:00 

 

How to solve this ? Thanks in advance

 

https://drive.google.com/file/d/1FK3aCiaDhk2kLYffl2lJztlSMc18h8P1/view?usp=sharing

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Similar to separating fiscal year, truncate "Shift Date" at 7:00 AM every morning,

CNENFRNL_0-1652687099066.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

1 REPLY 1
CNENFRNL
Community Champion
Community Champion

Similar to separating fiscal year, truncate "Shift Date" at 7:00 AM every morning,

CNENFRNL_0-1652687099066.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

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.