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 / Multiple colums in Pie...
Power Apps
Unanswered

Multiple colums in Pie Chart from SharePoint List

(0) ShareShare
ReportReport
Posted on by 32

Hi all,

 

I am trying to create a Pie Chart using data from a SharePoimt list.  I want to use 3 columns as my data for the chart but I can only pick one.

 

In my list I have a text column filled in by Month/year (I.e Jan-2021), from a Dropbox choosing the Month/Year the PieChart will then be filtered by that row of thr list.  I can get this part working fine.

 

The next part is where I am struggling, I want the pie chart to represent values from 3 different number columns.  For example for the row with the column Jan-2021 contains Column 1 with the figure 8, Column 2 has 4 and Column 3 has 12.

 

Can anyone help please?  If more info is needed just ask

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

    @SamSmithIPU 

    You will need to get your Items property of the Pie chart to the following structure:

    Table(
     {Column1: 8},
     {Column2: 4},
     {Column3: 12}
    )

     

    This is typically done in the following way:

    With({_items: Filter(yourList, yourCriteria)},
     {
     Column1: Sum(_items, Column1),
     Column2: Sum(_items, Column2),
     Column3: Sum(_items, Column3)
     }
    )
     

     

    I hope this is helpful for you.

  • SamSmithIPU Profile Picture
    32 on at

    Hi @RandyHayes

     

    I have copied that and made modifications but I am seeing the below error

     

    SamSmithIPU_0-1612827324258.png

     

    To help understand further, this is the modifications and what I am after:

     

    Modified Code:

     

    With({_items: Filter('Workshop KPI''s', 'Month Selection - M2M')},

    {

    Column1: Sum(_items, EngineeringRework),

    Column2: Sum(_items, SupplierRework),

    Column3: Sum(_items, WorkshopRework)

    }

    )

     

    'Month Selection - M2M' is the name of the Dropdown

     

    SharePoint List, please see attached

    Chart End Goal, please see attached

     

    The Chart Goal screenshot is what is currently being used in an Excel File for comparison of what I want in PowerApps

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

    @SamSmithIPU 

    Yes, your criteria of the Filter must be evaluate to a Boolean true or false.  I didn't specify the criteria because you mentioned that you already had that part working.

    So for your Filter, you need to compare your dropdown to the column in the list. 

    I would need to know the exact Items property of the dropdown to give an exact formula, but the basic idea is:

     

    With({_items: Filter('Workshop KPI''s', Month='Month Selection - M2M'.Selected.Value)},
     { 
     Column1: Sum(_items, EngineeringRework),
     Column2: Sum(_items, SupplierRework),
     Column3: Sum(_items, WorkshopRework)
     }
    )
  • SamSmithIPU Profile Picture
    32 on at

    Hi @RandyHayes ,

     

    Made a small change, Selected.Value is now Selected.Month.  Small oversight like when you misplace a full stop.

     

    The chart pulling data, but it is essentially where it was in the beginning without any formulas.  The Image below is only showing one column's worth of data, I'm not sure though as the label only says Item(1)

     

    SamSmithIPU_0-1612861810546.png

     

    For both dropdowns I see the below, is there a way to have all 3 columns grouped together as a selection but values still different so when they are displayed they are not all summed together and will show individually?

     

    SamSmithIPU_1-1612861990229.png

     

     

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

    @SamSmithIPU 

    Duh...hand smack to my head...my bad!

    I apologize, I left out a couple of important parts.  I either had one too many, or too long a day.

     

    Here is the formula you need:

    With({_items: Filter('Workshop KPI''s', Month='Month Selection - M2M'.Selected.Value)},
     Table(
     {label:"Engineering Rework", Value: Sum(_items, EngineeringRework)},
     {label:"Supplier Rework", Value: Sum(_items, SupplierRework)},
     {label:"Workshop Rework", Value: Sum(_items, WorkshopRework)}
     )
    )

    As you can see...vastly different.  I have no idea what I was thinking on my last reply.

     

    Throw that formula in and see what you get.  You should be able to select label for your Labels and Value for your series in the chart.

  • SamSmithIPU Profile Picture
    32 on at

    @RandyHayes You absolute Legend!!!

     

    I just had to make one word change and this worked, I changed Month='Month Selection - M2M'.Selected.Value to Month='Month Selection - M2M'.Selected.Month

     

    With({_items: Filter('Workshop KPI''s', Month='Month Selection - M2M'.Selected.Month)},
     Table(
     {label:"Engineering Rework", Value: Sum(_items, EngineeringRework)},
     {label:"Supplier Rework", Value: Sum(_items, SupplierRework)},
     {label:"Workshop Rework", Value: Sum(_items, WorkshopRework)}
     )
    )

     

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

    @SamSmithIPU 

    Ooops, I do recall you mentioned that change before.  I should have incorporated it in.

    But...glad you got it working now.

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