Forum Discussion

SamanthBha's avatar
SamanthBha
Regular Visitor
3 years ago
Solved

Custom time Format in pbi

 

 Actually i am having the below data in excel i will use customise format ([hh]:mm) same i have to get in Power bi, 

 

Can Anyone help me in this.

Time Open to Close ([hh]:mm:ss)
946:10:49
600:04:48
442:55:08
722:22:20
20:41:32
9:01:53
140:58:06
118:36:09
8:44:25
31:30:58
52:00:51
270:53:48
245:43:07
101:12:45
220:32:09
52:54:53
55:48:38
4:11:58
29:43:21
221:48:47
142:39:02
79:02:06
130:05:01
121:14:20
129:10:54
4:29:35
101:06:44
25:26:00
45:02:19

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi SamanthBha ,

    Please try to create a new column with below dax formula:

     

    Column =
    VAR _a = [Column1]
    VAR _hour =
        DIVIDE ( _a, 3600 )
    VAR _id1 =
        FIND ( ".", _hour )
    VAR _val =
        LEFT ( _hour, _id1 - 1 )
    VAR _b =
        MOD ( _a, 3600 )
    VAR _minute =
        DIVIDE ( _b, 60 )
    VAR _id2 =
        FIND ( ".", _minute )
    VAR _val1 =
        LEFT ( _minute, _id2 - 1 )
    VAR _second =
        MOD ( _b, 60 )
    RETURN
        _val & ":" & _val1 & ":" & _second
    

     

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi SamanthBha ,

    Please try to create a new column with below dax formula:

     

    Column =
    VAR _a = [Column1]
    VAR _hour =
        DIVIDE ( _a, 3600 )
    VAR _id1 =
        FIND ( ".", _hour )
    VAR _val =
        LEFT ( _hour, _id1 - 1 )
    VAR _b =
        MOD ( _a, 3600 )
    VAR _minute =
        DIVIDE ( _b, 60 )
    VAR _id2 =
        FIND ( ".", _minute )
    VAR _val1 =
        LEFT ( _minute, _id2 - 1 )
    VAR _second =
        MOD ( _b, 60 )
    RETURN
        _val & ":" & _val1 & ":" & _second
    

     

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.