The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
My database is based of Job ID that can run during 1st, 2nd or overlap between two.
I am having difficulty getting accurate resuts for shifts due to overlap between shifts.
1st shift 5 AM to 4.30 PM
2nd Shift 5.00 PM to 3.30AM
OFF Shift 3.30 AM to 5.00 AM.
What I want :
I want a forth result for "overlapping shift".
The custom column DAX I used (of course with help of this forum) is:
HI @Anonymous,
I tied to simple your formula and add the conditions deal with the 'second shift' situation, you can test with the below formula if it helps:
shift =
VAR _start =
TIMEVALUE ( Table[ActualStartTimeLocal] )
VAR _end =
TIMEVALUE ( Table[ActualEndTimeLocal] )
RETURN
IF (
MIN ( _start, _end ) = BLANK (),
BLANK (),
IF (
_start > TIME ( 3, 30, 00 )
&& _end < TIME ( 05, 00, 00 ),
"OFF SHFIT",
IF (
_start >= TIME ( 05, 00, 00 )
&& _end <= TIME ( 16, 30, 00 ),
"1st",
IF ( _start >= TIME ( 17, 00, 00 ) && _end <= TIME ( 3, 30, 00 ), "2nd" )
)
)
)
Regards,
Xiaoxin Sheng
User | Count |
---|---|
87 | |
84 | |
36 | |
35 | |
30 |
User | Count |
---|---|
96 | |
75 | |
67 | |
52 | |
52 |