Hello everyone!
I really, really need help with a formula to create percentages in a pie chart.
1. I have a SharePoint list.
2. This SharePoint list had been used into gallery ( GalleryEdit1 ) where I filtered based on the specific user ( User().email ).
3. I really, really need to create a pie chart in Power Apps that can calculate the percentage of each column in pie chart as below image (which I draw by myself for the expected result) where the percentage can be increased/decreased if any changes in the gallery.
4. The calculation that I can figure out is this
each column : FPoints of SRC / total FPoints *100%
total FPoints :
(FPoints of SRC + FPoints of Clubs/Society + FPoints of Special Events + FPoints of Ad-Hoc Teams)
Highly appreciated anyone's attention and guidance.🤗
Solved! Go to Solution.
Consider the following:
Change your Items property of the Pie Chart to -
AddColumns(
AddColumns(
GroupBy(
GalleryEdit_1.AllItems,
"EC_PA_Cri1",
"_recs"
),
"_total", CountRows(GalleryEdit_1.AllItems),
"_recTotal", CountRows(_recs)
),
"_label", EC_PA_Cri1 & " : " & Text((_recTotal/_total)*100, "%0")
)
Set the Series on your PieChart to _recTotal
Set the Labels on your PieChart to _label
I hope this is helpful for you.
I also had tried to use my friend's code where she gets the result as below image but when I apply to my case, unfortunately, it did not works😢.
The pie chart she had created
her code for the pie chart
Anyone could help me?😢
Consider the following:
Change your Items property of the Pie Chart to -
AddColumns(
AddColumns(
GroupBy(
GalleryEdit_1.AllItems,
"EC_PA_Cri1",
"_recs"
),
"_total", CountRows(GalleryEdit_1.AllItems),
"_recTotal", CountRows(_recs)
),
"_label", EC_PA_Cri1 & " : " & Text((_recTotal/_total)*100, "%0")
)
Set the Series on your PieChart to _recTotal
Set the Labels on your PieChart to _label
I hope this is helpful for you.
User | Count |
---|---|
161 | |
86 | |
68 | |
63 | |
62 |
User | Count |
---|---|
212 | |
146 | |
92 | |
81 | |
68 |