(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:
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:
Solved! Go to Solution.
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
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).
I hope this helps.
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
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).
I hope this helps.
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.
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.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
261 | |
123 | |
86 | |
81 | |
70 |