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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Calculate Data from Co...
Power Apps
Answered

Calculate Data from Collection/Dataverse

(0) ShareShare
ReportReport
Posted on by 171

I have a collection (the collection is then patched into a dataverse table at the end via a button) that is filled through two input fields with times in the format hh:mm as text. In the input field A the time is entered at which I started to work and in the input field B the end time. The special is that you can make several entries on the same day. Means for example 8:00 to 10:00 and then a new entry from 11:00 to 12:00 and more. Input field A and B are stored in separate columns in the collection. Now I want that I get at the end of the day a total number of hours calculated. How do I do that?

Categories:
I have the same question (0)
  • Verified answer
    NZ0090 Profile Picture
    317 on at

    @alt88 Do you have a column for date and EmployeeID? If you have a date column, you can filter your record by EmployeeID and today's date and then use the Sum and DateDiff function to get the total:

    Sum(
    Filter(CollectionName, EmpID=0001 && Date=Today()), 
    DateDiff(StartTime, EndTime, TimeUnit.Hours)
    )

     

     

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @alt88 ,

     

    Please try:

    vdezhilimsft_0-1678331120106.png

    Text(Sum(AddColumns(coltime,"totalHour",DateDiff(TimeValue(start),TimeValue(end),TimeUnit.Minutes)),totalHour)/60,"#.##")

    vdezhilimsft_1-1678331155808.png

     

    Best Regards,

    Dezhi

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 993

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 545

Last 30 days Overall leaderboard