Forum Discussion

RobertReeves's avatar
RobertReeves
Frequent Visitor
3 years ago
Solved

Create a time frame column from a datetime column

I have a table that has start and end times for calls. I need to create a column that has a time frame that the call took place in.  Is this possible in Power BI desktop? Below example has it split by hour, can it also be done by quarter hour?

Example:

 

StartTimeTime Frame
01/04/22 10:28 AM10:00:00 AM
01/11/22 11:24 AM11:00:00 AM
01/04/22 2:18 PM2:00:00 PM
01/05/22 10:46 AM10:00:00 AM
01/07/22 7:09 PM7:00:00 PM
02/15/22 2:10 PM2:00:00 PM
01/07/22 11:18 AM11:00:00 AM
01/11/22 2:45 PM2:00:00 PM
01/18/22 6:48 PM6:00:00 PM
03/21/22 2:43 PM2:00:00 PM
01/26/22 12:12 PM12:00:00 PM
02/03/22 10:12 AM10:00:00 AM
01/27/22 12:03 PM12:00:00 PM
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi RobertReeves ,

     

    I think you can try this code to create a calculated column.

    Time Frame = TIME(HOUR('Table'[StartTime]),00,00)

    Change the data type to Time. Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi RobertReeves ,

     

    I think you can try this code to create a calculated column.

    Time Frame = TIME(HOUR('Table'[StartTime]),00,00)

    Change the data type to Time. Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.