Formula for Time and minute calculation adding an extra minute

  • Formula for Time and minute calculation adding an extra minute

    Posted by DSC Communities on April 21, 2020 at 8:55 am
    • Joanne Osborne

      Member

      April 21, 2020 at 8:55 AM

      Hello,

      I’m hope someone can help me with this formula. I don’t understand why it’s adding an extra minute for the calculations. The time should only calculate to 1.01 not 1.02.

      This is my formula

      ——————————
      Thanks
      Joanne Osborne
      Data Analyst
      ——————————

    • Vincent Lacomme

      Member

      April 21, 2020 at 1:04 PM

      Hi Joanne,

      Can you show us the table content and the DAX or M formula regarding the Duration column ?

      ——————————
      Vincent L.
      Chartered accountant – Expert-comptable
      ——————————
      ——————————————-

    • Greg Philps

      Member

      April 21, 2020 at 1:20 PM

      Hi Joanne. Your calculation is showing decimal hours, not hours and minutes; the calculation looks correct, but the rounding to 2 decimal places I’m guessing is the source of the confusion. You can get the correct number of minutes in a calculated column with “Duration in Minutes = DATEDIFF( Shows[Start_Time], Shows[End_Time], MINUTE )”, then use “Duration 1 (Hours) = ROUNDDOWN( DIVIDE( Shows[Duration in Minutes], 60 ), 0 )” and “Duration 1 (Minutes) = Shows[Duration in Minutes] – ( Shows[Duration 1 (Hours)] * 60 )” to get the whole number hours and minutes. Hope this helps. Greg

      ——————————
      Greg Philps
      Power BI Consultant
      Ottawa ON Canada
      ——————————
      ——————————————-

    • Joanne Osborne

      Member

      April 21, 2020 at 2:00 PM

      Hi Greg,Ā 

      I’m so new to power bi.Ā 

      Would this be two different calculated columns that I need to create.Ā 

      I created the Duration in Minutes column but I’m a bit lost now as to the rest of your formula do I create another calculated column?

      ——————————
      Joanne Osborne
      Data Analyst
      ——————————
      ——————————————-

    • Greg Philps

      Member

      April 21, 2020 at 2:37 PM

      Hi Joanne. Yes, each formula is for a separate calculated column. Here’s the sample I cooked-up to check. Greg

      ——————————
      Greg Philps
      Power BI Consultant
      Ottawa ON Canada
      ——————————
      ——————————————-

    • Joanne Osborne

      Member

      April 21, 2020 at 3:21 PM

      Thanks, Greg, this works perfectly. Thank you so much for taking the time to help me. Much appreciated.

      Have a great day and please take care.

      Joanne

      ——————————
      Joanne Osborne
      Data Analyst
      ——————————
      ——————————————-

    DSC Communities replied 6 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Formula for Time and minute calculation adding an extra minute’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!