cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sabhat
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

4 REPLIES 4
poweractivate
Super User II
Super User II

@Sabhat 

 

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:

 

CompositePieChart.png

 

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.

 

 

v-yutliu-msft
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:

LookUp(PieChartSample,City="Cairo",Area)

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:

If(Gallery1.Selected.City="Cairo",true,false)

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.

 

1158.PNG

 

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

Announcements
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)