Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Please Help. Update piechart when clicking on a button

HI everyone, this is my first question I've ever asked on any form so please induldge me.


My case: I've made a button on a gallery and when I click on it I would like that a piechart that shows the related cases status (from d365).

Ex: Account Aldi has 6 cases, 4 open, 1 resolved, 1 cancelled. I have no idea how to do this, never worked with powerapps before. Please help


Screenshot (25).png

Super User II
Super User II



What you need help with specifically?


Try this first steps and see if they work:


When you add Pie Chart it adds a Composite Control like this:




You must select only the PieChart after it's added. So from above example there is Legend, Title, and PieChart - select only the Pie Chart control - next you will find it has an Items property. This is how you can change the Sample Pie Chart to something else such as Items from your data source.


Check if the above helps as starting point.



Community Support
Community Support

Hi @Sabhat ,

Do you want to display another field's data in the pie chart based on the selection of the gallery?

I'm afraid it's not supported in powerapps currently.

You could only set one label and one series in one pie chart. So you can not choose another field to display.

As an alternative way, you could add several labels to display the data that you want, put them above the pie chart and decide which one is visible based on the selection of the gallery.

I've made a similar test for your reference:

In my test, I have 10 parts in my pie chart, so I insert 10 labels.

put labels to its related parts of the pie chart

set label's Text like this:


On your side, you should set the lable beside Aldi:

LookUp(Table,Account Name="AlDi",Status)

 set the lable beside Devimo:

LookUp(Table,Account Name="Devimo",Status)


Then, set the label's Visible like this:


On your side, you should try:

If(Gallery1.Selected.Account Name="AlDi",true,false)


Then, the label will display based on the selection of the gallery and the label display the related status value.




Best regards,

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

Thank you for your answer, I was looking more toward the formula necessary to populate the piechart 

Thank you for your answer, my data is coming form Dynamics 365. I wanted to know by selecting the account (the button in the gallery) how many cases are related to it. My thinking was if I could get the child records (cases) for each account and show the status of each cases. There are 3 status for each case : Active, Resolved or Cancelled. I'm not sure if this is possible and I don't know how related entities work in canvas app.

Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,975)