web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Calculating the durati...
Power Automate
Answered

Calculating the duration of a meeting in Outlook and converting to a number of hours to 2 decimal places

(0) ShareShare
ReportReport
Posted on by 16

Hi folks,

 

First up, I am very much a layman when it comes to this and have had some success in learning as I stumble through Power Automate. I am very much in awe of the level of knowledge here and has already been useful!

 

I have created a recurring flow that will grab all of the events/meetings in my M365 Outlook calendar for the upcoming week and populate it into MS Lists and for most of the attributes I want to import, this works really well.

Where I am really struggling is calculating the duration of a given meeting, in hours, and reporting this as a number to 2 decimal places into my list into the budgeted hours field (in red below). I can already add in numbers when I manually add in new entries in the list.

 

RobElliott1_0-1688063724770.png

I have become totally stuck on this so any help as to how I would go about this is appreciated.

Is it possible to include the "Start Time" and "End Time" fields from Outlook in the Dynamic Content area to be used in an expression and what's the general syntax for that? I have been trying to use div and sub expressions but having no joy at all!

 

Thanks in advance!

Categories:
I have the same question (0)
  • Verified answer
    wskinnermctc Profile Picture
    6,519 Moderator on at

    You can use the dateDifference() expression and then split out the hours or minutes from the string. OR You could also use a ticks() expression and formula.

     

    I think the ticks() expression would work better for you, since you need a final number for billable hours. 

     

     

    Here is a reference. It looks long, but mainly because it is detailed. Scan through it and you should be able to see how to get what you want.

    https://powerusers.microsoft.com/t5/General-Power-Automate/Using-the-dateDifference-expression-or-ticks-to-find-difference/m-p/2195863#M129167

     

    This will get the hours difference with decimal result.

     

    div(sub(float(ticks({EndDateTime})),float(ticks({StartDateTime}))),36000000000)

     

     

    Note: This is for full DateTime fields. It doesn't work for Time only fields. 

    If you have a Time only field, then you should put it together with the date to make a full DateTime field.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard