Forum

Notifications
Clear all

Calculation of cumulative hours

2 Posts
2 Users
0 Reactions
106 Views
(@usb)
Posts: 244
Honorable Member
Topic starter
 

In the attachment I need cumulative hours of each week
Each week will give the cumulative FIX HOURS on Sundays through Thursdays inclusive
I need him to do the summary calculation for each week separately
How do you do that?

Thank you very much, Leah

 
Posted : 02/02/2022 9:34 am
Alan Sidman
(@alansidman)
Posts: 223
Member Moderator
 

Is this the result you would be looking for in the attached.  If so, then this Power Query Mcode should be sufficient.

let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"DATE", type date}}),
#"Inserted Week of Year" = Table.AddColumn(#"Changed Type", "Week of Year", each Date.WeekOfYear([DATE]), Int64.Type),
#"Removed Columns" = Table.RemoveColumns(#"Inserted Week of Year",{"Cumulative hours"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"SUM", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type1", {"Week of Year"}, {{"Total Hours Per Week", each List.Sum([SUM]), type any}})
in
#"Grouped Rows"

It would be very helpful, if you had supplied a mocked up solution so that we clearly understood your needs.

 
Posted : 02/02/2022 12:50 pm
Share: