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 / group by with sum and ...
Power Apps
Unanswered

group by with sum and count in sharepoint list

(0) ShareShare
ReportReport
Posted on by 16

Hi guys!!

I can't move forward

I'm trying to SUM and Count in a GroupBy, with SharepintLists.

 

In SQL the query shoud be like that:
select ROUND.ID, count(QUESTION.Id),sum(QUESTION.Time)
from ROUND r
inner join QUESTION s on ROUND.Id=QUESTION.IdRound
where QUESTION.result=true
group by ROUND ID

 

I tried to put the results into a Gallery,
Now i got at ITEMS-> GroupBy(Filter(QUESTION,result=true),"ID","Group1")
and into the gallery i put a label-> CountRows(ThisItem.Group1)

How can I add one label for COUNT and other label for SUM??

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @isma_ept1991 ,

    Using your field names provided - something like this

    AddColumns(
     GroupBy(
     Filter(
     QUESTION,
     result=true
     ),
     "ID",
     "Group1"
     ),
     "CountItems",
     CountRows(Group1),
     "SumItems",
     Sum(Group1,Time)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • isma_ept1991 Profile Picture
    16 on at

    Many thanks!!
     About this function, how could i join this table to another table and get a new column from that table?

     

    example.PNG

  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    @isma_ept1991 ,

    Note this is free-typed, but you will get the idea - your Count would not alter, but to get the Time total from List B, something like this

    AddColumns(
     GroupBy(
     AddColumns(
     Filter(
     QUESTION,
     result=true
     ),
     "bTime",
     Lookup(
     TableB,
     IdTableA=ID
     ).Time
     ),
     "ID",
     "Group1"
     ),
     "CountItems",
     CountRows(Group1),
     "SumItems",
     Sum(Group1,bTime)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard