Forum Discussion

Pooja-B's avatar
Pooja-B
Regular Visitor
3 years ago
Solved

Convert minutes into hours

Hi,
   In Power BI I have a column name has Worked minutes as 110 minutes.
 This 110 minutes I have to convert into hours as "1:50"
 How to convert the 110 as 1:50

Thanks in advance,
Pooja-B.

  • Arul's avatar
    Arul
    3 years ago

    Pooja-B ,

    Are you using the same formula? I got the correct output.

    Please see the below,

    Thanks,

    Arul

9 Replies

  • Pooja-B's avatar
    Pooja-B
    Regular Visitor

    Hi Arul ,
     I need that hours coulumn datatype as  decimal numbers because I need to add the sum of worked hours.
    I already have workedMinutes column have data as 110 "Whole number datatype".
    The hours column I need 1:50 as decimal number datatype.

    In above mentioned thread they were in text datatype.

    Thanks,
    Pooja-B

     

    • Arul's avatar
      Arul
      Icon for Super User rankSuper User

      Pooja-B ,

      If you requirement is to calculate the sum of hours, Can you try the below formula in measure?

      Minutes to Hours = 
      VAR _hours = ROUNDDOWN(DIVIDE(SUM('Table'[Minutes]),60),0)
      VAR _minutes = MOD(SUM('Table'[Minutes]),60)
      VAR _result = FORMAT(_hours,"#00")&":"&FORMAT(_minutes,"#00")
      RETURN _result

      Thanks,

      Arul;

      • Pooja-B's avatar
        Pooja-B
        Regular Visitor

        Hi Arul ,
          Thank you so much for your response. Its working fine.
         But I need some exact answer sir.

        I have 2 times here, 
                        Minutes    Hours
                          220            3:40
                          225            3:45
        Total Hours worked = 7:25
        The above your given code, I tried in "calculated measure" its working in table visual but not working in the stacked column chart visual


        Thanks,
        Pooja-B