Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DAX

Hello,

I have a column named Check-In Time where I have date in 7:50:09 AM format. I want to create a new column where I can classify the time range. For example: Early morning, Late morning, Afternoon, Evening, Late Night, After Midnight. Please help. 

Thank you

  • Anonymous , You can create using Switch

    A new column =

     

    Switch ( True(),

    [Check in Time] <time(7,0,0) , "Early Morning",

    [Check in Time] <time(12,0,0) , "Late Morning",

    [Check in Time] <time(16,0,0) , "Afternoon",

    // Add other

    "Night"

    )

1 Reply

  • Anonymous , You can create using Switch

    A new column =

     

    Switch ( True(),

    [Check in Time] <time(7,0,0) , "Early Morning",

    [Check in Time] <time(12,0,0) , "Late Morning",

    [Check in Time] <time(16,0,0) , "Afternoon",

    // Add other

    "Night"

    )