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 / Building a GroupBy Gal...
Power Apps
Answered

Building a GroupBy Gallery to show average score

(1) ShareShare
ReportReport
Posted on by 183
Hey all, I'm working on a gallery from a SharePoint data source.

My organization is doing a survey of all coworkers and wants a Power App dashboard built to review the data. The survey consists of 10 questions based on a strongly disagree to strongly agree scale. I've gone ahead and given point values to each of the choice optoins from 1 to 5. 

I want to take a local collection I've created within the PowerApp, and group by all of the responses by their work location. Then ultimately get the average for each work location using all 10 questions in a single new AddColumn.
 
I keep trying to use the GroupBy function, but I keep erroring out.
 
ClearCollect(groupedData, GroupBy(colProviderData, "ProviderLocation", "GroupData"));
ClearCollect(finalData, AddColumns(groupedData, "TotalScore", Sum(GroupData, QuestionTwoValue + QuestionThreeValue)));

 
Any help or insight would be greately appreciated!
Categories:
I have the same question (0)
  • Verified answer
    mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at
    hey
     
     
    can u try this approach:
    ClearCollect(
        groupedData,
        GroupBy(colProviderData, "ProviderLocation", "GroupData")
    );
    
    ClearCollect(
        finalData,
        AddColumns(
            groupedData,
            "AverageScore",
            Sum(
                GroupData,
                QuestionOneValue + QuestionTwoValue + QuestionThreeValue + 
                QuestionFourValue + QuestionFiveValue + QuestionSixValue +
                QuestionSevenValue + QuestionEightValue + QuestionNineValue +
                QuestionTenValue
            ) / 10
        )
    );
    
    if it worked please mark as verified answer,
     
     
    cheers
  • NathanFra Profile Picture
    183 on at
    @mmbr1606,

    I tried that, but the original ClearCollect on the groupedData is throwing an error.


    It is saying "expected identified name" to both of the strings.
  • Verified answer
    WarrenBelz Profile Picture
    155,644 Most Valuable Professional on at
    @NathanFra​​​​​​​
    Just adding a clarification - you do not need quotes "" around the parameters and you can do it all in one action. Please mark @mmbr1606's post as the solution as the calculation was your main question.
    ClearCollect(
       finalData, 
       AddColumns(
          GroupBy(
             colProviderData, 
             ProviderLocation, 
             GroupData
          ),
          TotalScore, 
          Sum(
             GroupData, 
             QuestionOneValue + QuestionTwoValue + QuestionThreeValue + QuestionFourValue + QuestionFiveValue + 
             QuestionSixValue + QuestionSevenValue + QuestionEightValue + QuestionNineValue + QuestionTenValue
          ) / 10
       )
    );
     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 395

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 287 Super User 2026 Season 1

Last 30 days Overall leaderboard