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 / Split hours worked int...
Power Apps
Unanswered

Split hours worked into weeks of the month

(0) ShareShare
ReportReport
Posted on by 1,512

I have an app that I have a column called Work Hours this is a rollup of all of the hours entered by the user.  I need to split the hours into each respective week of the month to show how many hours are being worked in each week.

Dorinda_0-1658414422362.png

This is all in a SharePoint list so the data has the actual date it was entered in the app captured in SharePoint.

Dorinda_1-1658414508419.png

How can I do this?

Categories:
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @Dorinda ,

     

    With "WeekNum()" you can check if the week number the employee entered his work hours is the same as the week number you're displaying in your table.

  • Dorinda Profile Picture
    1,512 on at

    @WiZey 

     

    I made some progress in my gallery getting the week number 

    Dorinda_0-1658419797591.png

     

     

    Now I need to sum up each of those weeks to get total for each week.  That is where I am stuck now.

  • WiZey Profile Picture
    3,023 Moderator on at

    If I understood you well, using your picture as example, you want the sum of the "Total Hours" of each day for a specific "Week Number"?

     

    I don't know how your app was built, so the best solution I can give you is this formulae:

     

     

    Sum(Filter(cltYourCollection;WeekNum(yourDate) = WeekNum(currentDate));'Total Hours')

     

     

    Basically, you're giving the "Sum()" function a table of all records whose week number is equal to the week number you're looking for. The second parameter should be the column corresponding to the "Total Hours" (it's also an expression, so you can put in an arithmetic operation such as an addition of multiple columns if you need).

  • Dorinda Profile Picture
    1,512 on at

    This is giving me all kinds of errors,  I have the collection called colpwrsysele, this has all of the information from the SharePoint list.  My Date field in SharePoint is Called Date (yes I know i blew that one), but I am not sure if that is correct

    Sum(Filter(colpwrsysele;WeekNum(DatePicker1_2.SelectedDate) = WeekNum(DatePicker1_2.SelectedDate));'Total Hours')

     because I am getting all kinds of errors 

  • WiZey Profile Picture
    3,023 Moderator on at

    Could you give the list of the errors you're encountering please?

     

    Is "Total Hours" part of your SharePoint list, or is it calculated inside your app?

     

    By the way, you're comparing "WeekNum(DatePcker1_2.SelectedDate)" with itself, which will always return "true". In my exemple, I was suggesting comparing "WeekNum(collection.Date)" with "WeekNum(DatePicker.SelectedDate)", which should return "true" only if the date of the record has the same week number as the date selected in the datepicker.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard