cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SamSmithIPU
Frequent Visitor

Multiple colums in Pie Chart from SharePoint List

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

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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
Super User
Super User

@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)
    }
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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

 

 

RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@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
Super User
Super User

@SamSmithIPU 

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

But...glad you got it working now.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,755)