cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KevinSquirrels
Level: Powered On

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 Team
Community Support Team

Re: Using Choice Column in PieCharts

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 Team
Community Support Team

Re: Using Choice Column in PieCharts

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

KevinSquirrels
Level: Powered On

Re: Using Choice Column in PieCharts

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,915)