Forum Discussion
Measure - Normal Hours or OOH
- Anonymous4 years ago
Hi Anonymous ,
You could try this measure.
Normal Hours or OOH = VAR _date = MAX ( 'Table'[Date] ) VAR _hour = HOUR ( _date ) VAR _min = MINUTE ( _date ) VAR _sec = SECOND ( _date ) VAR _time = TIME ( _hour, _min, _sec ) RETURN IF ( WEEKDAY ( _date, 2 ) IN { 6, 7 }, "OOH", IF ( TIME ( 8, 0, 0 ) < _time && _time < TIME ( 17, 0, 0 ), "Normal", "OOH" ) )Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You could try this measure.
Normal Hours or OOH =
VAR _date =
MAX ( 'Table'[Date] )
VAR _hour =
HOUR ( _date )
VAR _min =
MINUTE ( _date )
VAR _sec =
SECOND ( _date )
VAR _time =
TIME ( _hour, _min, _sec )
RETURN
IF (
WEEKDAY ( _date, 2 ) IN { 6, 7 },
"OOH",
IF ( TIME ( 8, 0, 0 ) < _time && _time < TIME ( 17, 0, 0 ), "Normal", "OOH" )
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Stephen,
Thank you for helping, unfortunatley its now showing everything as OOH? I've change the date from table to 'Task Created Date' Would this be an issue? Thanks again!
- Anonymous4 years agoNot applicable
Hi Anonymous ,
I guess you have a problem with the underline here, you don't need to add ".Date".
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.