Forum Discussion
syaifulefendi
3 years agoFrequent Visitor
ASK HELP - Getting Tolerable Shift from Date
Hi
Kindly help me to get result on result column with Dax as shown below
start time if <= 9AM , tolerable will be 9AM , beside this will be same as schedulle or Shift Start column
Thanks
SE
As a calculated column you could add it like this.
Tolerable Late (Result) = IF ( HOUR ( 'Table'[Shift Start] ) <= 9, DATEVALUE ( 'Table'[Shift Start] ) + TIME ( 9, 0, 0 ), 'Table'[Shift Start] )If you are looking for a measure it would be like this.
Tolerable Late (Result) Measure = VAR _ShiftStart = SELECTEDVALUE ( 'Table'[Shift Start] ) RETURN IF ( HASONEVALUE ( 'Table'[Shift Start] ), IF ( HOUR ( _ShiftStart ) <= 9, DATEVALUE ( _ShiftStart ) + TIME ( 9, 0, 0 ), _ShiftStart ), BLANK() )Thanks brother
2 Replies
- jdbuchanan71Super User
As a calculated column you could add it like this.
Tolerable Late (Result) = IF ( HOUR ( 'Table'[Shift Start] ) <= 9, DATEVALUE ( 'Table'[Shift Start] ) + TIME ( 9, 0, 0 ), 'Table'[Shift Start] )If you are looking for a measure it would be like this.
Tolerable Late (Result) Measure = VAR _ShiftStart = SELECTEDVALUE ( 'Table'[Shift Start] ) RETURN IF ( HASONEVALUE ( 'Table'[Shift Start] ), IF ( HOUR ( _ShiftStart ) <= 9, DATEVALUE ( _ShiftStart ) + TIME ( 9, 0, 0 ), _ShiftStart ), BLANK() )- syaifulefendiFrequent Visitor
Thanks brother