Forum Discussion
thmonte
6 years agoHelper IV
Shaping Date Using a Shift Offset?
I am working with employee pay records and I have employees where their shift overlaps days. For example: I am scheduled to work Thursday 3/19 but I come in at 6PM Wednesday and work till 6AM Th...
thmonte
6 years agoHelper IV
Defintely gotta check out your book! I've been using PowerBI for years and sometimes I hit a brick wall. Would love to learn a new approach on things. What do you think of this approach. It seems to be working based on what I can see
Column =
var start_shift = 'Table Pay'[start_time_date] + TIME(18,00,00)
var end_shift = 'Table Pay'[start_time_date] + TIME(23,59,59)
var stmt = IF('Table Pay'[SHIFT_CODE] = 20 && 'Table Pay'[START_TIME] >= start_shift && 'Table
Pay'[START_TIME] <= end_shift, 'Table Pay'[start_time_date] +1, 'Table Pay'[start_time_date])
return stmt
This forces all records that have an overlapping shift and in a range of 1600-2359 to +1 to that date. This should then give a me a column I can use in a relationship with a main Date table to filter off of.
Greg_Deckler
6 years agoCommunity Champion
I'd have to test it be certain, but I'm a big fan of things that work! 🙂
If it is working for you and you can do what you need to do, then it sounds like the way to go.
It's tough to get to specific answers for people because it is hard to convey all of the context involved in their particular situations so you are the ultimate judge of what works and what doesn't!
If it is working for you and you can do what you need to do, then it sounds like the way to go.
It's tough to get to specific answers for people because it is hard to convey all of the context involved in their particular situations so you are the ultimate judge of what works and what doesn't!