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 Apps / Calculate with times
Power Apps
Answered

Calculate with times

(0) ShareShare
ReportReport
Posted on by

Hello!

So I am calculating the time between 2 times using 4 dropdown boxes. The time is being displayed like this:

https://gyazo.com/c85df24cfc1d1b80e6c0372d8a9a5fac

I then have another dropdown box where they can select the pause they had. This will be in minutes (15, 30, 45, 60)

I then want to calculate the tijd totaal - the pause in minutes

How could I do this? 

Code Tijd totaal: 

DateDiff(Time(
Value(DropBeginUur.Selected.Value),
Value(DropBeginMinuten.Selected.Value),
0),Time(
Value(DropEindUur.Selected.Value),
Value(DropEindMinuten.Selected.Value),
0),Minutes) / 60.0

The dropdown for pause is named DropPause


Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

    You would seem to have a valid formula.  What has gone wrong?  Please provide an example of what you input, what the output was, and what the answer should be.

     

    Why did you divide by 60 at the end of the formula?  You can control the 'Units' in the 3rd argument of DATEDIFF so this seems unnecessary.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    on at

    I did not make that code myself but it basically calculates the time between 4 dropdownboxes. This code works totally fine. Here is an example: https://gyazo.com/ae308ba31c8fb5e89a6e27bd6e44b526

    Now I want to have another textfield that calculates the time - the pause. 

    Now for an example I have added another dropdownbox that is named pause. So I need to add another textfield where the time - the pause is stated. 

    Now the total time = 7.25 which is equal to 7 hours and 15 minutes. The pause dropdown box is 30 minutes, so the time in the new textfield should be: 6.75

    I hope this made it more clear. @mdevaney 

  • Community Power Platform Member Profile Picture
    on at

    Anyone able to help me?

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @Anonymous ,

     

     

    Please try this:

    (DateDiff(Time(
    Value(DropBeginUur.Selected.Value),
    Value(DropBeginMinuten.Selected.Value),
    0),Time(
    Value(DropEindUur.Selected.Value),
    Value(DropEindMinuten.Selected.Value),
    0),Minutes)-Pause.Selected.Value) / 60.0

    Pause.Selected.Value means the pause minutes you selected from pause dropdown.

    Sik

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard