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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Show Count of Data on ...
Power Apps
Unanswered

Show Count of Data on Pie Chart

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi!

 

I have a Pie Chart in Power Apps and a SharePoint List Text column called "Feedback". The contents of the Text column is the multi-select answers from a Microsoft Form. The each answer has "" around it.

 

I want to count how many time a feedback answer is shown in the Text column and show that in the Pie Chart in Power Apps.

 

For example :

 

  • SharePoint List
    • Row 1 ="Poor Communication"
    • Row 2 = "Poor Communication","Lack of Skills".

Therefore the Pie Chart would count 2 for "Poor Communication" and 1 for "Lack of Skills".

 

What is the item property code in the Chart for this? 

 

I can also make this SharePoint List column a Multi-Select Choice if needs be

 

Many Thanks!!

 

Sarah

Categories:
I have the same question (0)
  • MarkRahn Profile Picture
    1,229 Super User 2025 Season 2 on at

    Hi @s_tanswell84 

     

    I made some assumptions on what your data looks like. Based on your example,

    MarkBandR_0-1718037815677.png

    In Power Apps, I added a button to do the following:

    //Replaces the line return Char(10) with "," and then splits on ","
    ClearCollect(SplitItems, Split(Substitute(First('YourSharePointList').Feedback, Char(10),","),","));
    
    ClearCollect(DistinctCounts,
     AddColumns(
     GroupBy(SplitItems, Value, Count),
     DistinctCount,
     CountRows(Count)
     )
    )

    Replace First('YourSharePointList').Feedback with the selected SharePoint Item. I just defaulted it to the First Item in the List for an example.

     

    This should get you a DistinctCounts collection that looks like this:

    MarkBandR_1-1718038042022.png

    You should be able to wire that up to your Pie Chart.

     

    -Mark

    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up.

  • s_tanswell84 Profile Picture
    Microsoft Employee on at

    Thanks @MarkBandR ! However, it's not picking up the data. Below is an example of one of the answers below:

     

    ["Poor communication/Lack of updates","Other"]

     

    The full line of data starts and ends with square brackets, and the individual answers selected in the multi select answer in the Form are divided by ,. Each answer is also surrounded by "". Do I need to change your code above?

  • MarkRahn Profile Picture
    1,229 Super User 2025 Season 2 on at

    Hi @s_tanswell84 ,

     

    You said you had a multiline field in a SharePoint List named "Feedback". You are trying to consolidate the data to show in a pie chart.

     

    What does that data look like? Is it all stored in a single SharePoint List Item or in multiple SharePoint List Items?

    Example of Single SharePoint List Item:

    MarkBandR_1-1718119939078.png

    Feedback field contains two responses

     

    Example of Multiple SharePoint List Items:

    MarkBandR_0-1718119853449.png

    Feedback field contains one response. Each SharePoint List Item is one response.

     

    Also I am assuming that the first string (example: "Poor communication/Lack of updates") indicates that two things were checked in the response ("Poor communication" and "Lack of updates"). You are not concerned with anything after the first response for the Pie Chart.

     

    Let me know.

    -Mark

     

  • s_tanswell84 Profile Picture
    Microsoft Employee on at

    Hi @MarkBandR ! It is Multi Items:

    s_tanswell84_0-1718120847767.png

     

    The options for the user to select in the Microsoft Form (which are then fed through to create a New Item in the SharePoint List via Power Automate) are:

     

    • Poor communication/Lack of updates
    • Poor technical skills
    • Ticket was passed to multiple teams
    • Engineer did not turn up to calls
    • Asked to provide logs multiple times
    • Was asked for the same information repeatedly
    • Handover process to the next engineer was poor
    • Felt the engineer did not read the notes/information I had previously provided
    • Other
  • MarkRahn Profile Picture
    1,229 Super User 2025 Season 2 on at

    Hi @s_tanswell84 

     

    Based on the information you have provided, I made a Screen with a Container for the Pie Chart.

    MarkBandR_0-1718131845958.png

    The List data looks like this with a Column named "Feedback":

    MarkBandR_1-1718131965780.png

     

    Copy this code and use the new "Paste"-"Paste Code <Preview>" feature to paste it into your Power App.

     

    - con_PieChart:
     Control: GroupContainer
     Variant: manualLayoutContainer
     Properties:
     Height: =933
     Width: =626
     Y: =60
     Children:
     - comp_PieChartGroup:
     Control: Group
     Children:
     - legend_PieChart:
     Control: Legend
     Properties:
     Items: =Sort(pie_PieChart.SeriesLabels,Value,SortOrder.Descending)
     Height: =283
     ItemColorSet: =pie_PieChart.ItemColorSet
     Size: =16
     Width: =534
     X: =40
     Y: =650
     - pie_PieChart:
     Control: PieChart
     Properties:
     Items: =colDistinctChoicesAndCounts
     Height: =570
     Width: =534
     X: =40
     Y: =83
     - lbl_PieTitle:
     Control: Label
     Properties:
     Text: ="Chart Title"
     Align: =Align.Center
     Height: =36
     Size: =14
     Width: =534
     X: =40
     Y: =40
     - btn_LoadData:
     Control: Classic/Button
     Properties:
     OnSelect: |
     =ClearCollect(
     colFeedbackItems,
     'YourSharePointListGoesHERE'
     );
     Clear(colAllChoices);
     ForAll(
     colFeedbackItems As FeedbackItem,
     ForAll(
     ParseJSON(FeedbackItem.Feedback) As FeedbackChoice,
     //Assumes Feedback is a text field in the format
     //["Poor communication/Lack of updates","Poor technical skills","Other"]
     Collect(
     colAllChoices,
     {
     ChoiceValue: Text(FeedbackChoice)
     }
     )
     )
     );
     ClearCollect(
     colDistinctChoicesAndCounts,
     AddColumns(
     GroupBy(
     colAllChoices,
     ChoiceValue,
     Count
     ),
     DistinctCount,
     CountRows(Count),
     LabelWithCount,
     $"{ChoiceValue} ({CountRows(Count)})"
     )
     );
     Text: ="Load Data"
     Width: =184
     X: =432
     Y: =27
    

     

    Update the 'YourSharePointListGoesHERE' with your SharePoint List data source. The button has the code to create the Collection for the Pie Chart.

    ClearCollect(
     colFeedbackItems,
     'YourSharePointListGoesHERE'
    );
    Clear(colAllChoices);
    ForAll(
     colFeedbackItems As FeedbackItem,
     ForAll(
     ParseJSON(FeedbackItem.Feedback) As FeedbackChoice,
     //Assumes Feedback is a text field in the format
     //["Poor communication/Lack of updates","Poor technical skills","Other"]
     Collect(
     colAllChoices,
     {
     ChoiceValue: Text(FeedbackChoice)
     }
     )
     )
    );
    ClearCollect(
     colDistinctChoicesAndCounts,
     AddColumns(
     GroupBy(
     colAllChoices,
     ChoiceValue,
     Count
     ),
     DistinctCount,
     CountRows(Count),
     LabelWithCount,
     $"{ChoiceValue} ({CountRows(Count)})"
     )
    );

    Hopefully this gets you what you need.

     

    -Mark

    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up.

     

  • MarkRahn Profile Picture
    1,229 Super User 2025 Season 2 on at

    Hi @s_tanswell84 

     

    How are you making out with this?

     

    -Mark

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard