Forum Discussion
Anonymous
7 years agoNot applicable
Shifted Start Date with Year to Date Since Inception
Hi all, I'm new to Power BI and am trying to transform date data (sourced from SQL Server) according to the shift scheme we use. For propery reporting to my users, I need to determine which shift da...
- Anonymous7 years ago
Hi Anonymous ,
I share a sample measure formula to mark your shift date and index, you can try it if it works on your side:
Shift Index = VAR _currDate = MAX ( Table[timestamp] ) VAR _shiftIndex = IF ( HOUR ( _currDate ) >= 6 && HOUR ( _currDate ) <= 17, "1st", "2nd" ) VAR _shitfDate = IF ( HOUR ( _currDate ) <= 3, _currDate - 1, _currDate ) RETURN _shitfDate & " " & _shiftIndexI'm not so clarify for your condition #3, can you please explain more about this?
In addition, if above not help, please provide some sample data to help us clarify your data structure and test to coding formula.Regards,
Xiaoxin Sheng
Anonymous
7 years agoNot applicable
Hi Anonymous ,
I share a sample measure formula to mark your shift date and index, you can try it if it works on your side:
Shift Index =
VAR _currDate =
MAX ( Table[timestamp] )
VAR _shiftIndex =
IF ( HOUR ( _currDate ) >= 6 && HOUR ( _currDate ) <= 17, "1st", "2nd" )
VAR _shitfDate =
IF ( HOUR ( _currDate ) <= 3, _currDate - 1, _currDate )
RETURN
_shitfDate & " " & _shiftIndex
I'm not so clarify for your condition #3, can you please explain more about this?
In addition, if above not help, please provide some sample data to help us clarify your data structure and test to coding formula.
Regards,
Xiaoxin Sheng