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 / Pie Chart for one column
Power Apps
Unanswered

Pie Chart for one column

(1) ShareShare
ReportReport
Posted on by 66

Hi everyone, I need quick help, 

 

I have a SharePoint list for the RAG analysis column (calculated column) and I need to represent that in the Pie chart for selected employees. plz, help how can I set it up. 

 

what i am expecting an outcome is when i choose an employee name in the drop-down list, the pie chart should filter its data from SP list and show RAG options in the pie chart. here is a screenshot of the SharePoint list  - 

 

ashar1990_0-1691237133777.png

ashar1990_1-1691237188928.png

 

 

 

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @ashar1990 

    Here's how you can set up a pie chart in your Power Apps Canvas App to display the RAG (Red-Amber-Green) analysis for a selected employee.

     

    You first should add a ComboBox for the employee names and a PieChart control:

     

    1. Add a ComboBox control to your screen.
    You should set the Items property of the ComboBox to your SharePoint list to load all employee names.

    This formula should be something like:

    ComboBox1.Items = Distinct('YourSharePointList', 'EmployeeNameColumn')

    Make sure to replace 'YourSharePointList' and 'EmployeeNameColumn' with your actual SharePoint list name and employee name column respectively.

    2. Add a PieChart control to your screen.
    You should set the Items property of your PieChart1 to filter the SharePoint list based on the selected employee in the ComboBox. This formula should be:

    Filter('YourSharePointList', 'EmployeeNameColumn' = ComboBox1.Selected.Result)

    Again, replace 'YourSharePointList' and 'EmployeeNameColumn' with your actual SharePoint list name and employee name column.

     

    3. Configure the PieChart.
    The PieChart control needs to know which fields to use for the sector values and labels. This can be achieved by setting the PieChart1 Series property to point to your 'RAG' column like this:

    {Value: 'RAGColumn', SeriesColor: 'ColorColumn'}

    Replace 'RAGColumn' and 'ColorColumn' with your actual RAG column and color column in the SharePoint list. If you don't have a color column, you can set colors directly in the formula like this for the Series property of your PieChart1:

    {
     Value: 'RAGColumn', 
     SeriesColor: Switch('RAGColumn', 
     "Red", RGBA(255, 0, 0, 1), 
     "Amber", RGBA(255, 191, 0, 1), 
     "Green", RGBA(0, 255, 0, 1)
     )
    }
    

    In this formula, the Switch function maps each 'RAG' value to a corresponding color.

     

    With these settings, when you select an employee name in the ComboBox, the PieChart should update to show the RAG analysis for the selected employee. Please replace placeholder values in the formulas above with your actual column names and data.

     

    See if it helps @ashar1990 

     

  • ashar1990 Profile Picture
    66 on at

    @poweractivate thank you so much for your response and detailed walk through . 

     

    I am stuck at point where i need to add value to series property of the Pie chart. I can not locate it in the drop down list in formula bar . there is one option only but it show me list of my SP list columns. 

     

    ashar1990_0-1691324252293.png

     

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @ashar1990 

    Here is a possible workaround using a table (collection) to aggregate your data:

    1. On the OnChange event of your ComboBox, use a formula to create a collection that aggregates the RAG data for the selected employee. Use the GroupBy function to achieve this. Here's an example formula:

    ClearCollect(
     RAGCollection, 
     GroupBy(
     Filter('YourSharePointList', 'EmployeeNameColumn' = ComboBox1.Selected.Result),
     "RAGColumn",
     "Group"
     )
    )
    


    Replace 'YourSharePointList', 'EmployeeNameColumn', and 'RAGColumn' with your actual SharePoint list name and appropriate column names.

     

    This formula groups the items by RAG status and creates a collection with each unique RAG status and a sub-table 'Group' with all the items belonging to that status.

     

    2. Then, create another collection that calculates the number of items in each group:

    ClearCollect(
     RAGCounts, 
     AddColumns(
     RAGCollection, 
     "Count", CountRows(Group)
     )
    )
    


    This formula adds a new column 'Count' to the RAGCollection, where each row's 'Count' is the number of items in that row's 'Group'.

     

    3. Now, set the Items property of your PieChart to this new collection RAGCounts.

     

    Now the pie chart should display sectors based on the number of each RAG status for the selected employee.

    Each sector's value should be the count of items with that status, and the label should be the status itself (Red, Amber, or Green).

     

    Please replace the placeholders in the formulas with your actual list and column names. 

     

    See if it helps @ashar1990 

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard