cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MihirY
Level 8

How to do a group by with Choice field

I am having a choice field called Cateogry which is having values as "Sancks,Electronics, Books" etc. Now i want to group by these SharePoint list items with category and show on Pie chart as well as in Gallery. Earlier I have maitained in single line of text for cateogry field. Then i have used below formula. Since I have changed column data type from Single line of text to choice, this formula will not work. This is giving error at column name and saying, expected values are Text. how to deal with this? Is it an issue or limitation?

AddColumns(GroupBy('Purchase Orders',"Category", "Group"), "TotalQuantity", Coalesce(Sum(Group, Quantity),0))
1 ACCEPTED SOLUTION

Accepted Solutions
gokello
Level 8

Re: How to do a group by with Choice field

Workaround:
Use AddColumns to introduce a new field based on the Complex field then group by the new field.

e.g. if my choice field is Category 

 

Groupby(AddColumns(DataSourceName, "NewFieldName",Category.Value),"NewFieldName","GroupName")

View solution in original post

3 REPLIES 3
Highlighted
Community Support Team
Community Support Team

Re: How to do a group by with Choice field

Hi MihirY,

 

Thanks for feedback.

 

Per my test, I found that a Choice column type is not supported in the GroupBy function.

 

Please consider to submit a request at PowerApps ideas Forum:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

I will help and collect it on my side.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MihirY
Level 8

Re: How to do a group by with Choice field

It is sad to know that Choice field is not supported for GroupBy function. Any workaround is there? 

One workaround i think is:

We can create one more field in the same list with single line of text and update the value with workflow as choice field value. Now use that field in groupby function inside powerapp. But this is too indirective way. What you think?

I have submitted an idea in power apps form for Choice field not supported in groupby function.

gokello
Level 8

Re: How to do a group by with Choice field

Workaround:
Use AddColumns to introduce a new field based on the Complex field then group by the new field.

e.g. if my choice field is Category 

 

Groupby(AddColumns(DataSourceName, "NewFieldName",Category.Value),"NewFieldName","GroupName")

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,870)