cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
audrieg
Power Automate
Power Automate

Problem with Pie Chart Report

(added one more record so this would make more sense to you)

 

I have added a chart to the screen.

I have set the items property to the connection

 

Data source has 3 records:

records.PNG

 

I have set the advanced properties as shown below.

I want Sum(Count) with code labels (so the pie should only have 2 slices and AVEH should be the larger slice)

 

In a normal Bar Chart or Pie Chart the series values that are the same will aggregate....but this one is just reporting every instance of the same series name independently. Any ideas as to why? See the two identical code values below:

 

 

ChartControl.PNG

 

 

Properties.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
rgruian
Power Apps
Power Apps

Audrie,

 

Pie charts do not currently aggregate in the manner you pointed out. To get that aggregation, you need to group by the labels field, and summarize by the count/series field:

 

SummaryPieChart_B.Items = AddColumns(GroupBy('Zone ReviewRevised', "Code", "Group"), "Count", Sum(Group, Count))

    Labels = Code

    Series = Count

 

pic1.png

 

If you are interested in seeing what kind of structure the above formula produces, please Collect it into a local collection, and inspect in the Collections page (ribbon).

 

pic2.png

 

I hope this helps.

 

Radu Gruian [MSFT] ** PowerApps Staff

View solution in original post

4 REPLIES 4
rgruian
Power Apps
Power Apps

Audrie,

 

Pie charts do not currently aggregate in the manner you pointed out. To get that aggregation, you need to group by the labels field, and summarize by the count/series field:

 

SummaryPieChart_B.Items = AddColumns(GroupBy('Zone ReviewRevised', "Code", "Group"), "Count", Sum(Group, Count))

    Labels = Code

    Series = Count

 

pic1.png

 

If you are interested in seeing what kind of structure the above formula produces, please Collect it into a local collection, and inspect in the Collections page (ribbon).

 

pic2.png

 

I hope this helps.

 

Radu Gruian [MSFT] ** PowerApps Staff

View solution in original post

ok. I will give that a try. But honestly, what is the use case for a pie chart that doesnt do that? Seems counter intuitive.

 

Fair point. However do keep in mind that the summarization operation is not always the same (Sum), so baking such an operation into the chart itself would not be right. I have seen examples just in the past couple of days where the requirement was to aggregate differently (count rows, compute averages, etc). That's what the PowerApps language is for -- it gives you the freedom to express those operations in a composable fashion, and cleanly separate concerns -- the language transforms and manipulates data, the visuals render it.

 

That said, I agree that the chart experience needs to be refined. It would be great if you could make some suggestions on the PowerApps Ideas forum.

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Thank you.

Radu Gruian [MSFT] ** PowerApps Staff

Thanks for those clarifications (I do have a post on the ideas forum). I don't think not having it work just like a pie in Power BI would make it more 'flexible'. PowerBI is flexible - but the pie charts you add to it group identical series out of the box. (In this case, the "Labels" advanced property should be grouped.) I would like to see consistentcy across the data apps: What a pie chart does out of the box in Power Bi, Excel, and Power Apps too. (In every case, the end user can change the properties to make something unique to his use case happen.)

 

One other question;

 

I tried to edit your expression to constrain the pie to just todays entries, but it won't accept my filter. Do you see what I'm doing wrong here?

 

AddColumns(GroupBy(Filter('Zone ReviewRevised',IsCreated(Today)), "Code", "Group"), "Count", Sum(Group, Count)

 

Never mind: I figured it out: It should be IsToday(Created) - thanks anways! 🙂

 

Thanks for your help.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,970)