Forum Discussion

lennox25's avatar
lennox25
Icon for Post Patron rankPost Patron
2 years ago
Solved

Help with Calculated Column which is not working as it should

Hi, 

 

Can someone help please?

 

This calculated column is not working as it should for some reason its not picking up all the required times as it should. Where I have highlighed in yellow it should be picking up those times too

Out of Hours Emails Recd =
  VAR __DateTime = [Date & Time]
  VAR __Hour = HOUR('Mailbox'[Time])
  VAR __Result = IF__Hour >= 6 && __Hour <8 || __Hour >= 16 && __Hour <18|| __Hour >= 18 && __Hour <6|| WEEKDAY(__DateTime,2) > 5,1,0)
RETURN
  __Result
 

 

3 Replies

  • pls try this

    Out of Hours Emails Recd =
      VAR __DateTime = [Date & Time]
      VAR __Hour = HOUR('Mailbox'[Time])
      VAR __Result = 
    IF( 
    __Hour >= 0 && __Hour <8 || 
    __Hour >= 16 && __Hour <18|| 
    __Hour >= 18 && __Hour <24||
    WEEKDAY(__DateTime,2) > 5,
    1,0)
    RETURN
      __Result
    • lennox25's avatar
      lennox25
      Icon for Post Patron rankPost Patron

      Thank you for answering and providing a solution so quickly 🙂