web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Pie chart with percent...
Power Apps
Answered

Pie chart with percentage is not working

(0) ShareShare
ReportReport
Posted on by 40
I want to display percentage and text in the piechart. 
 
Item:
AddColumns(DirectReporteeCol, "Percentage", Text(CompStatus/Sum(DirectReporteeCol,CompStatus)*100, "[$-en-GB]0.0%" ) )
 
 
Collection :
 
JD14_0-1621492060645.png

 Pie Chart:

JD14_1-1621492151891.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @JD14 ,

    Since your CompStatus column is not a Number column, you cannot directly use "CompStatus/Sum(DirectReporteeCol,CompStatus)*100" to get the percentage. You can check the Percentage column inside collection DirectReporteeCol, it should be 0.0%. (also "Sum(DirectReporteeCol,CompStatus)" cannot get correct value, you should use CountRows function)

     

    So for your requirement, you can create a new collection including a table with CompStatus column and Number column(numbers of same CompStatus value). I did a test on my side, you can refer to my steps:

    1. Here is my collection with 7 records:

    v-albai-msft_2-1621496120452.png

     

    2. Add a button with below formula to create a new collection called "colchart"(replace with your own CompStatus value):

    ClearCollect(colchart,
    Table( {CompStatus:"Agree",Number:CountRows(Filter(DirectReporteeCol,CompStatus="Agree"))/CountRows(DirectReporteeCol)}, 
    {CompStatus:"Disagree",Number:CountRows(Filter(DirectReporteeCol,CompStatus="Disagree"))/CountRows(DirectReporteeCol)},
    {CompStatus:"Strongly Agree",Number:CountRows(Filter(DirectReporteeCol,CompStatus="Strongly Agree"))/CountRows(DirectReporteeCol)},
    {CompStatus:"Strongly Disagree",Number:CountRows(Filter(DirectReporteeCol,CompStatus="Strongly Disagree"))/CountRows(DirectReporteeCol)}
     )
     )

    v-albai-msft_5-1621496435738.png

     

    3. Set items property of PieChart control to:

    AddColumns(colchart,"percentage",Text(Number*100,"[$-en-GB]##0.0%"))

    v-albai-msft_3-1621496374525.png

    4. Set Items property of Legend control to:

    colchart.CompStatus

    v-albai-msft_6-1621496524436.png

    5.  Open Advanced tab of PieChart control, and select “percentage” option of Labels dropdown:

    v-albai-msft_7-1621496575375.png

     

    Check result this time: 

    v-albai-msft_8-1621496607761.png

     

    Best regards,

    Allen

     

     

     

  • JD14 Profile Picture
    40 on at

    Thanks a lot Allen. Appreciate your Help!!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard