Forum Discussion

atjt217's avatar
atjt217
Helper III
5 years ago
Solved

Grouping Time by Hour Intervals

Hello,  I hope someone can tell me how to fix this issue. I'm trying to create a calculated column that show time intervals by hour. What i did is i used add a column by hour on Power Query on Creat...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  atjt217 ,

    Here are the steps you can follow:

    1. Create calculated column.

    C_CreateIOn =
    var _1=FORMAT('Table'[CreateIOn],"AM/PM")
    var _2=
    IF(
        'Table'[CreateIOn Hour]>12,
        'Table'[CreateIOn Hour]-12,
        'Table'[CreateIOn Hour])
    return
    _2&""&_1

    2. Result:

     

    Best Regards,

    Liu Yang

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

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  atjt217 ,

    Here are the steps you can follow:

    1. Create calculated column.

    C_CreateIOn =
    SWITCH(
        TRUE(),
        'Table'[CreateIOn Hour]>12,'Table'[CreateIOn Hour]-12&""&"PM",
        'Table'[CreateIOn Hour]=12,'Table'[CreateIOn Hour]&""&"PM",
        'Table'[CreateIOn Hour]<12,'Table'[CreateIOn Hour]&""&"AM")

    2. Result:

     

     

    Best Regards,

    Liu Yang

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