Skip to main content

Notifications

Community site session details

Community site session details

Session Id : TV0DFxdm8vZ29Cct7LilPz
Power Apps - Building Power Apps
Answered

Count Group By Table

Like (0) ShareShare
ReportReport
Posted on 18 Feb 2022 15:29:18 by 8

Hi,

 

I have a sharepoint list from which I need to create a table that looks like the one below. The problem is that both Category and Nominees are tables. Category is a multiple choice column on sharepoint so it is listed as table while Nominees are person column that can contain even multiple people for each category. What I need to do is a table that counts how many projects for each category (Unique or distinct) and then how many nominees for each Category. Problem I am encountering is that those are tables inside tables inside tables (nested tables). Thanks a lot for your help. 

 

ViTko_0-1645197972484.png

 

Categories:
  • ViTko Profile Picture
    8 on 21 Feb 2022 at 14:42:55
    Re: Count Group By Table

    Thanks a lot for your help Randy.

     

    V. 

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 18 Feb 2022 at 17:15:50
    Re: Count Group By Table

    @ViTko 

    Very good.  Then your formula would be:

    AddColumns(
     GroupBy(
     AddColumns(yourListName,
     "_category", Category.Value
     ),
     "_category", "_records"
     ),
     "_projectCount", CountRows(_records),
     "_nomineeCount", Sum(ForAll(_records, {Value: CountRows(Nominee)}), Value)
    )
  • ViTko Profile Picture
    8 on 18 Feb 2022 at 16:48:15
    Re: Count Group By Table

    Hi Randy,

     

    This is exactly what I wanted, but I also need to add to it that Nominee column so it counts how many persons are for each project. Nominee column is a "Person or Group" column that allows for multiple selections. 

    Thanks a lot for helping me.

     

    V.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 18 Feb 2022 at 15:46:01
    Re: Count Group By Table

    @ViTko 

    So then consider the following to group your data:

    AddColumns(
     GroupBy(
     AddColumns(yourListName,
     "_category", Category.Value
     ),
     "_category", "_records"
     ),
     "_projectCount", CountRows(_records)
    )

     

    The above will give you the categories grouped and the counts for the projects.

     

    As for the nominees, tell me more about that column - I know it is a person column as you have mentioned, but is it multiple-select or single-person?

  • ViTko Profile Picture
    8 on 18 Feb 2022 at 15:39:09
    Re: Count Group By Table

    Well, I dont know if they are nested but I have problems to do a groupby on the columns that are choice ones on Sharepoint. Thanks a lot for your help. In this case Category is a choice and Nominee is a person so it contains a lot of information for each record such as email, displayname etc. Thanks a lot for your help.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 18 Feb 2022 at 15:34:41
    Re: Count Group By Table

    @ViTko 

    Can you explain more about how it is that you have a SharePoint list that has nested tables in it?

    If that is not what you meant, then can you provide the formula you are using to group your data?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started