Forum Discussion

BassKroon's avatar
BassKroon
Frequent Visitor
8 years ago
Solved

Converting Whole Number to Minutes

Hello, 

 

Im working with a data set that has a whole number in it. 

I want to convert these whole numbers to a time so the number will be set to minutes. And ofcourse when im going to analyse it, the minutes will eventually count up to hours and days. 

 

Can someone help me out with this? 

 

Excuse me for my bad english, ill hope you will understand my question.

 

 

  • Hi BassKroon,

    Based on my test, you could refer to below steps:

    1.I have entered some sample data(minutes) like the picture below:

    2.Create a measure.

    Measure = IF(SUM(Minutes[Minutes])/60<1,ROUND(SUM(Minutes[Minutes]),2)&"Minute",

              IF(SUM(Minutes[Minutes])/60>=1&&SUM(Minutes[Minutes])/1440<1,ROUND(SUM('Minutes'[Minutes])/60,2)&"Hours",

              IF(SUM(Minutes[Minutes])/1440>=1,ROUND(SUM(Minutes[Minutes])/1440,2)&"Day")))

    3.Create a Card visual and a table visual, now you can see the result.

    You can also download the PBIX file to have a view.

    https://www.dropbox.com/s/auaeub6awzlun88/Converting%20Whole%20Number%20to%20Minutes.pbix?dl=0

     

    Regards,

    Daniel He

     

5 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi BassKroon,

    Based on my test, you could refer to below steps:

    1.I have entered some sample data(minutes) like the picture below:

    2.Create a measure.

    Measure = IF(SUM(Minutes[Minutes])/60<1,ROUND(SUM(Minutes[Minutes]),2)&"Minute",

              IF(SUM(Minutes[Minutes])/60>=1&&SUM(Minutes[Minutes])/1440<1,ROUND(SUM('Minutes'[Minutes])/60,2)&"Hours",

              IF(SUM(Minutes[Minutes])/1440>=1,ROUND(SUM(Minutes[Minutes])/1440,2)&"Day")))

    3.Create a Card visual and a table visual, now you can see the result.

    You can also download the PBIX file to have a view.

    https://www.dropbox.com/s/auaeub6awzlun88/Converting%20Whole%20Number%20to%20Minutes.pbix?dl=0

     

    Regards,

    Daniel He

     

    • AmberJane's avatar
      AmberJane
      Icon for Helper III rankHelper III

      This worked great for me but its not sorting as expected: mins > hours > days or vice versa. Any suggestions?

       

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you! It is helpful. I would like some help with your card visual 2, If the minutes are 70 then it should show 1.10 (but currently it is showing 1.17), Is it possible to get the data in this format?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Looking for assistance.

    Description of issue:

    When deducting duration from Time, after an hour 00.00 and before 00.45, the value is not deducted correctly.

    Walkthrough:


    Working with columns:

    "OpenHoursTo" as text value, eg. 


    "DeliveryTime" as whole number eg. 15, 45, 0

     

    Purpouse -  find the timestamp: OpenHoursTo - DeliveryTime


    Step_1: Transform text value of column "OpenHoursTo" to Time, we get eg: 16:00

     

    Step_2: Transform whole number of column "DeliveryTime" to Duration

     

    So if DeliveryTime is 15, transformed value is - 0.00:15:00

    Formula used: DeliveryTime = #duration(0,0,0, [DeliveryTime]*60) (NOT SURE IF THIS IS CORRECT)

    Result:

     

     

    As can be seen highkighted values, except the last one give an incorrect result. Once the clock hits between 00.00 & 00.45, the values are not deducted correctly.

    Any ideas how can I fix this issue?

    Thanks, 
    Ed

    • dedelman_clng's avatar
      dedelman_clng
      Icon for Community Champion rankCommunity Champion

      As this thread is already marked solved, you will get more responses if you create a new thread specifically for your issue