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 / A list of choices in a...
Power Apps
Unanswered

A list of choices in a column and totalling number of times a choice has been chosen

(0) ShareShare
ReportReport
Posted on by 15

I have a choice column with model names of printers. I want a simple list where you can see:

 

Model / Number of times chosen

C257 / 3

C259 /10

 

I tried getting this to work for hours but no luck. It should be fairly simple for anyone experienced, I would appreciate any help.

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,721 Super User 2026 Season 1 on at

    Hi @Learnean 

     

    The GroupBy function in Power Apps to group your choice column by the model names and then count the number of records in each group. You can then display the result in a gallery or a table.

    Assume that your choice column is named Model and it is in a data source named Printers

    Create a collection named ModelCount using this formula:

    ClearCollect(
     ModelCount, 
     GroupBy(Printers, "Model", "Group")
    )
    

    To count the number of times each model has been chosen, you can add another column to the collection using this formula:

    AddColumns(
     ModelCount, 
     "Count", 
     CountRows(Group)
    )
    

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Learnean Profile Picture
    15 on at

    I get "Invalid number of arguments: received 2, expected 3 or more"

    GroupBy('Lists metadata', "Model", "Group")

     

    This is what my sharepoint list looks like:

    Skjermbilde (1).png

  • SpongYe Profile Picture
    5,721 Super User 2026 Season 1 on at

    Hi @Learnean 

     

    Based on the documentation the code should work https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-groupby#group-records.

     

    Do you have a screenshot of the code? In the formula bar, so I can have a better look why it gives a error.

  • Learnean Profile Picture
    15 on at

    That error went away but now: "The specified column "Model" does not exist.

    ClearCollect(
     ModelCount,
     GroupBy('Lists metadata', "Model", "Group")
    );
    AddColumns(
     ModelCount,
     "Count",
     CountRows(Group)
    )

     It clearly does exist. I changed it to a column with text and it worked then. but not Mode which is choice?

  • SpongYe Profile Picture
    5,721 Super User 2026 Season 1 on at

    Please check the column schema name of Model and adjust it to that. 

    Model may be the name of the column but Powerapps use the column schema name.

     

     

  • Learnean Profile Picture
    15 on at

    Ok, so the name should be field_7. When I changed it to that, I get "Expected a text, numeric, boolean, or date/time value."

     

    ClearCollect(
     ModelCount,
     GroupBy('Lists metadata', "field_7", "Group")
    );
    AddColumns(
     ModelCount,
     "Count",
     CountRows(Group)
    )

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard