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 / groupby item and get a...
Power Apps
Answered

groupby item and get a count

(0) ShareShare
ReportReport
Posted on by

I am trying to learn working with charts.  I have a list that holds a category with other stuff.  The categories are something like ID, DEF, ETC.  These are Choices and I know GroupBy does not like choices.

Several items in this list will be in their respective categories.  I want to do a chart that will show me with a count of how many items are in ID or DEF or ETC whatever. 

 

I can seem to get it right.  I tried this for instance
GroupBy(AddColumns('TOPICS',"phases",Text(phase.Value),"count",Filter('TOPICS',"phase" = "ThisRecord.phase.Value")),"phases","count")

I get this set (forgot to attach).  I can only assume that column "count" is giving [Table] because of the results of Filter, but if I do CountRows in there it does not like that either saying not supported for this connector.  So I must be approaching this wrong.

Any advice would be appreciated.

Screen Shot 2024-01-03 at 11.36.23 AM.png
Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @gstlouis ,

     

    Please try:

    AddColumns('GroupBy(AddColumns('TOPICS',"phases",Text(phase.Value)),"phases","NewGroup"),"count",CountRows(NewGroup))

     

    Best Regards,

    Bof

  • gstlouis Profile Picture
    on at

    @v-bofeng-msft 
    You are brilliant.  This worked and plugged into pie charts perfectly providing the count ratio of all the categories.

    Screenshot 2024-01-04 085501.png

    Question, I can see the results from the syntax in power apps under the Fx box like this.  The group_name NewGroup shows its a [Table].  Assuming its the dataset, is this accessible? 

    Screenshot 2024-01-04 085842.png

     

    It seems rather difficult to get a count beside the category titles.  I have tried experimenting with concatenating with addcolumns but it turned into a nightmare.  If you have a better approach please share.

     

    Screenshot 2024-01-04 134200.png

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

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard