Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Compare if Datetime is Before a Time

Hello, I am trying to create a new column by comparing if the datetime is before 5pm on the same day. For example:

 

If [datetime column] is before 5 pm then "Attend Appt" else "Miss Appt".

 

Is there any function that can help me with this problem?

  • Hi Anonymous ,

     

    Create a column with below code:-

    Column = if(HOUR('Table (2)'[Datetime]) < 17,"Attend Appt","Miss Appt")

     

    Thanks,

    Samarth

2 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi Anonymous ,

     

    Create a column with below code:-

    Column = if(HOUR('Table (2)'[Datetime]) < 17,"Attend Appt","Miss Appt")

     

    Thanks,

    Samarth

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      May I ask what if i want to make it before 5.30pm?