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 / Creating a Pie Chart w...
Power Apps
Answered

Creating a Pie Chart with Sharepoint Lists

(0) ShareShare
ReportReport
Posted on by 10

Hello,

 

I've been trying to create a pie chart for Company Assets by employee type.

 

I've tried looking at other threads for help but am stuck.

 

The list I am pulling from is named Master Asset List.

 

The blue entries are all the same "employee type" Entry

Chart.PNG

details.PNG

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Narculis 

    What is your Items property on the chart and what are you trying to get to in your chart?

  • Narculis Profile Picture
    10 on at

    I want the chart to be Company assets by employee type.

     

    Not entirely sure what you mean by the item's property. I didn't change any properties after I imported them from my sharepoint list.

     

    I'm very new to power apps

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Narculis 

    Click on the Pie Chart control in your app designer and then go to the top and choose the Items property from the dropdown next to the formula editor and let me know what the Formula is there.

  • Narculis Profile Picture
    10 on at

    advanced.PNG

    property.PNG

    Not sure if this is what you are looking for. Master Asset List has a data type of Table

     

    And this is ideally what I would like the chart to look similar to. I made this in PowerBI, but do not pay for it, so I can not add it to the app.

    powerbi.PNG

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Narculis 

    Not exactly, but it is close enough and provides what I need.

     

    I am not sure what you are doing with the collect formula in the OnSelect, but that seems out of place.

     

    So, your chart is using field_9 for labels and field_2 for series data.  My first guess is that you have imported from Excel into SharePoint...so, what is the column in your list that contains the employee type (and what kind of column is it?) and what is the column that contains the Assets?

     

    And I assume based on your BI chart that you are looking for a count of assets by employee type!?

  • Narculis Profile Picture
    10 on at

    Except for Employee names each column type is Single Line of Text. Here is a screenshot of the list columns. In the list the column names are"Company Asset" and "Employee type" I did in fact import the list into Sharepoint from excel.

     

    I'm not sure why they are still listed as Field_2 and Field_9 as I renamed them. Field 9 should be employee type. and Field 2 should be Company Assets

     

    I didnt edit the onselect, so that is what it defaulted to

    data card.PNG

    list.PNG

    I appreciate the help as this is my first powerapps project.

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Narculis 

    Yes, you cannot actually rename a column in SharePoint.  It might look like you did (as there is an option to rename), but behind the scenes, it will always have the original name.  So, when you import from Excel, it will create all the columns as field_x.  In many cases it will then try to "rename" them, or you end up doing it, but the column will always be field_x.

    To determine a column's real name, you can click on the column in the List Settings of your list and then in the address bar of your browser, look at the end of the URL - it will show the real name.

     

    That OnSelect action of your PieChart is not a "default" action.  That had to be added.

     

    So, as for your chart...

    If you want to show the counts of the assets by employee types, then you need to group on the employee types.

    So, you Items formula on the PieChart needs to become:

    AddColumns(
     GroupBy('Master Asset List',
     "EmployeeTypeColumnName",
     "_assets"
     ),
     "_counts", CountRows(_assets)
    )

     

    Your Labels will then be the employee type column name and the series would be "_counts".

  • Narculis Profile Picture
    10 on at

    Thank you, this worked for me.

     

     

    working.PNG

    What would I need change if  I wanted to make more charts for the Army, NASA, and Fema assets?

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