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 / How to groupby choice ...
Power Apps
Unanswered

How to groupby choice column

(0) ShareShare
ReportReport
Posted on by 248

Hi Everyone 

Can someone please suggest me how to use GroupBy function with choice column. i have tried all they but nothing worked.

GroupBy(AddColumns('Abcr Tracker', "ChoiceText", Unit.Value), "ChoiceText",    "GroupedData")
attached is the screenshot.

 

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @aayaanmayank 

     

    can you try this please:

    GroupBy(
     AddColumns(
     'Investment request Tracker',
     "ChoiceText", Unit.Value
     ),
     "ChoiceText",
     "GroupedData"
    )
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • aayaanmayank Profile Picture
    248 on at

    there is no difference in both the formulas but i have tried and still getting the same error 

  • Verified answer
    CarlosFigueira Profile Picture
    on at

    @aayaanmayank is your Power Apps version 3.24042 or later? If so, there was a change in the syntax of those functions (see blog post and release notes), so it should be written as

    GroupBy(
     AddColumns('Abcr Tracker', ChoiceText, Unit.Value),
     ChoiceText,
     GroupedData)

    Hope this helps!

  • aayaanmayank Profile Picture
    248 on at
    thanks It worked
  • Paramesh Ulthi Profile Picture
    17 on at
    In PowerApps, grouping data based on a **Choice** column from a SharePoint list can be tricky because PowerApps treats **Choice** columns as records rather than simple text values. However, you can work around this by converting the **Choice** values into text and then using the `GroupBy` function.
    Here's a step-by-step approach to group data by a SharePoint **Choice** column in PowerApps:
    ### Scenario:
    You have a SharePoint list with a **Choice** column, and you want to group items based on this column.
    ### Steps:
    1. **Retrieve the Data:**
       First, retrieve your SharePoint list data using the `Choices` function. Assuming your SharePoint list is called `MyList` and the **Choice** column is `Status`:
       ```PowerApps
       ClearCollect(MyCollection, MyList)
       ```
    2. **Convert the Choice Column to Text:**
       Since the **Choice** column is treated as a record, you need to access the actual text value. You can use `ThisRecord.Status.Value` (replace `Status` with your column name).
       ```PowerApps
       AddColumns(MyCollection, "StatusText", Status.Value)
       ```
    3. **Use the GroupBy Function:**
       Now that you have converted the **Choice** column to text (`StatusText`), you can group the data based on this new column.
       ```PowerApps
       GroupBy(AddColumns(MyCollection, "StatusText", Status.Value), "StatusText", "GroupedItems")
       ```
    4. **Display the Grouped Data:**
       You can bind this grouped collection to a gallery or any control where you need to display grouped data. For instance:
       - Use a gallery to display the unique **Status** values (group headers).
       - Inside that gallery, you can use another gallery to display the items under each group.
    ### Full Example:
    Assume your SharePoint list is named `MyList`, and you want to group items based on the **Status** choice column.
    ```PowerApps
    ClearCollect(MyCollection, MyList);
    ClearCollect(
        GroupedCollection,
        GroupBy(
            AddColumns(MyCollection, "StatusText", Status.Value),
            "StatusText",
            "GroupedItems"
        )
    );
    ```
    - `MyCollection`: Holds the data from the SharePoint list.
    - `GroupedCollection`: Contains the grouped data where each record has a `StatusText` (group name) and `GroupedItems` (items in that group).
    Now, bind `GroupedCollection` to a gallery control, and within that gallery, you can display the grouped data.
    ---
    Let me know if you need help with displaying or manipulating the grouped 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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard