cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Using Choice Column in PieCharts

I have an SP list called hazards and a choice column called Cause. Inside the choice column I have examples called Slips, Trips, Falls etc. I'd like to create a PieChart in my PowerApp to count how many of each cause I have in my SP list.

 

I have now idea where to start but during my search I came accross the GroupBy and AddColumns formula.

 

This is what I have so far

 

GroupBy(AddColumns(Hazards,"Causes",Cause.Value),"Cause","GroupData"),"CountByCause",CountRows(GroupData))

 

Can someone point me in the right direction please

 

Thanks 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @KevinSquirrels ,

Do you want to display the count of each cause from your SP List within the Pie Chart control?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Pie Chart control to following:

AddColumns(
GroupBy(
AddColumns(
Hazards,
"CauseValue",
Cause.Value
),
"CauseValue",
"GroupData"
),
"Count",
CountRows(GroupData)
)

then within Pie Chart control, set the Labels property to CauseValue column, Series property to Count column.

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @KevinSquirrels ,

Do you want to display the count of each cause from your SP List within the Pie Chart control?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Pie Chart control to following:

AddColumns(
GroupBy(
AddColumns(
Hazards,
"CauseValue",
Cause.Value
),
"CauseValue",
"GroupData"
),
"Count",
CountRows(GroupData)
)

then within Pie Chart control, set the Labels property to CauseValue column, Series property to Count column.

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Fantastic thank you. This worked perfectly.

 

One more cheeky question if I may. Can I filter by date picker. I have a column in the SP list called "Date Raised". I'd like to add a date picker on ther Pie Chart Screen. Then the user can select a date and the pie chart will show all SP rows added since that date and display the cause pie chart accordingly.

 

Hope that makes sence. 

 

Thanks again

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (46,614)