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,615 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
    154,496 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard