cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marc2510
Helper I
Helper I

calculate a value in a groupby gallery

I have 1 gallery using groupby and a second gallery showing the selected items from gallery1.

 

this is used for the gallery 1 = 
GroupBy( AddColumns(WorkTracker, "studentName", 'Student Name'.Value ), "studentName", "dataRecords" ) 

each item in a sharepoint list get a value of 1.
Im looking to calculate these together and be shown on gallery one

marc2510_0-1610019968476.png
currently I have tried 
Sum(WorkTracker,Score)

but this is showing the total of all items not the selected item (should equal to 3)

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@marc2510 

Please consider changing your Formula to the following:

 

AddColumns(
    GroupBy(
        AddColumns(WorkTracker, "studentName", 'Student Name'.Value ), 
        "studentName", 
        "dataRecords"
    ),
    "_scoreSum", Sum(dataRecords, Score)
)

 

The _scoreSum will contain the sum of the scores in each record associated with each studentName.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

1 REPLY 1
RandyHayes
Super User III
Super User III

@marc2510 

Please consider changing your Formula to the following:

 

AddColumns(
    GroupBy(
        AddColumns(WorkTracker, "studentName", 'Student Name'.Value ), 
        "studentName", 
        "dataRecords"
    ),
    "_scoreSum", Sum(dataRecords, Score)
)

 

The _scoreSum will contain the sum of the scores in each record associated with each studentName.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (32,249)