cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PArboucher
New Member

Summing data in nested table

My SP source list has multiple records for person per month.  (below)

 

namedate/monthhours
ron9/1/202215
ron9/1/202210
ron10/1/202210
ron10/1/202210
mary10/1/202212
tim10/1/202213
tina10/1/202214
ron11/1/202210

 

I want my end result to be (below)  records by person by month summing  the hours

 

namedate/monthhours
ron9/1/202225
ron10/1/202220
mary10/1/202212
tim10/1/202213
tina10/1/202214
ron11/1/202210

 

i place my first table in a collection just fine.  I use the GroupBy(somecollection,"name","date/month",DATA)

That groups the data just fine and the  table (DATA) of extra information has my hours by month. Perfect.

Trick is, I what the sum of the hours per month to be a column at the higher level, not in the DATA table. (my end table above)

I can't seem to figure that out.

 

Any thoughts?

 

Many thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@PArboucher 

You can add that column to your table results.

Ex:

AddColumns(
    GroupBy(somecollection,
        "name","date/month","DATA"
    ),
    "_monthSum", Sum(DATA, hours)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@PArboucher 

You can add that column to your table results.

Ex:

AddColumns(
    GroupBy(somecollection,
        "name","date/month","DATA"
    ),
    "_monthSum", Sum(DATA, hours)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,980)