web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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
    WarrenBelz Profile Picture
    153,529 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
       )
    );
     
  • 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
    mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard