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 from SharePo...
Power Apps
Answered

Pie Chart from SharePoint List

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I have share point list with different questions which contains form survey results for example:

Q1                               Q2                            Q3                         Q4
Agree                          Disagree                   Strongly Agree     Strongly Disagree
Strongly Agree           Strongly Disagree     Disagree               Agree

 

What I want is to summarize my response result (in percentage) which contains these answers?

 

Can someone please help on this?

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Any update on this thread?

    Thanks

  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you want to show the percentage based on all the results? Like your example, show the percentage based on 8 results? If so, I did a test on my side, you can refer to my steps:

    1. This is my list called “list8”:

    v-albai-msft_0-1616133348002.png

    2. Go to the app, set OnStart property of App to below. This will create a collection to keep all the results into a one-column- table. Then count the percentage based on this table.

    ClearCollect(collist,list8);
    ClearCollect(colresults,
    Split(Left(Concat(collist,Question1&", "&Question2&", "&Question3&", "&Question4&", "),
    Len(Concat(collist,Question1&", "&Question2&", "&Question3&", "&Question4&", "))-2),
     ", "
    ));
    ClearCollect(colchart,
    Table(
     {Result:"Agree",Number:CountRows(Filter(colresults,Result="Agree"))/CountRows(colresults)},
     {Result:"Disagree",Number:CountRows(Filter(colresults,Result="Disagree"))/CountRows(colresults)},
     {Result:"Strongly Agree",Number:CountRows(Filter(colresults,Result="Strongly Agree"))/CountRows(colresults)},
     {Result:"Strongly Disagree",Number:CountRows(Filter(colresults,Result="Strongly Disagree"))/CountRows(colresults)}
     )
     )

    v-albai-msft_1-1616133348005.png

    3. Add a pie chart, set items property of PieChart control to:

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

    v-albai-msft_2-1616133348009.png

    4. Set Items property of Legend control to:

    v-albai-msft_3-1616133348013.png

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

    v-albai-msft_4-1616133348014.png

    Check results this time:

    v-albai-msft_5-1616133348016.png

    If you want to show percentage for each question, you can refer to below steps:

    1. Add a dropdown box for selecting question, set its Items to:

    ["Question1","Question2","Question3","Question4"]

    v-albai-msft_6-1616133348018.png

    2. Add a button to search the percentage of selected question. Set its OnSelect property to:

    ClearCollect(colrecord,
    Switch(Dropdown1.SelectedText.Value,
    "Question1",Table(
     {Result:"Agree",Number:CountRows(Filter(collist,Question1="Agree"))/CountRows(collist)},
     {Result:"Disagree",Number:CountRows(Filter(collist,Question1="Disagree"))/CountRows(collist)},
     {Result:"Strongly Agree",Number:CountRows(Filter(collist,Question1="Strongly Agree"))/CountRows(collist)},
     {Result:"Strongly Disagree",Number:CountRows(Filter(collist,Question1="Strongly Disagree"))/CountRows(collist)}
     ),
    "Question2",Table(
     {Result:"Agree",Number:CountRows(Filter(collist,Question2="Agree"))/CountRows(collist)},
     {Result:"Disagree",Number:CountRows(Filter(collist,Question2="Disagree"))/CountRows(collist)},
     {Result:"Strongly Agree",Number:CountRows(Filter(collist,Question2="Strongly Agree"))/CountRows(collist)},
     {Result:"Strongly Disagree",Number:CountRows(Filter(collist,Question2="Strongly Disagree"))/CountRows(collist)}
     ),
    "Question3",Table(
     {Result:"Agree",Number:CountRows(Filter(collist,Question3="Agree"))/CountRows(collist)},
     {Result:"Disagree",Number:CountRows(Filter(collist,Question3="Disagree"))/CountRows(collist)},
     {Result:"Strongly Agree",Number:CountRows(Filter(collist,Question3="Strongly Agree"))/CountRows(collist)},
     {Result:"Strongly Disagree",Number:CountRows(Filter(collist,Question3="Strongly Disagree"))/CountRows(collist)}
     ), 
    "Question4",Table(
     {Result:"Agree",Number:CountRows(Filter(collist,Question4="Agree"))/CountRows(collist)},
     {Result:"Disagree",Number:CountRows(Filter(collist,Question4="Disagree"))/CountRows(collist)},
     {Result:"Strongly Agree",Number:CountRows(Filter(collist,Question4="Strongly Agree"))/CountRows(collist)},
     {Result:"Strongly Disagree",Number:CountRows(Filter(collist,Question4="Strongly Disagree"))/CountRows(collist)}
     ) 
    ))

    3. Add a pie chart, set items property of PieChart control to:

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

    4. Set Items property of Legend control to:

    colrecord.Result

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

    v-albai-msft_7-1616133348019.png

    Check results this time(after selecting a question, must click search to get the results):

    v-albai-msft_8-1616133348023.png

    Best Regards,

    Allen

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard