cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
The_General
Level: Powered On

Pie Charts from Sharepoint List

I am really struggling to get a pie chart to show the following from a list in sharepoint

 

Sharepoint has 2 columns

 

Title and Question

 

Title contains the following the word week and then a number for a eg Week 1 and Question shows the reponse to a question eg Red, Blue, Green

 

The table looks like

 

Week1, Red

Week1, Red

Week1, Blue 

Week1, Green

Week1, Green

Week1, Green

Week2, Blue

Week2, Red

Week2, Green

 

I want the pie chart to show me the totals by question for week 1 only

 

I had been struggling with the AddColumns,Filter and GroupBy functions and cant seem to join them up in the right manner.

 

Thanks

 

Graham

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Pie Charts from Sharepoint List

@The_General 

 

Please use the below expression in your Pie Chart Items:
 
AddColumns(GroupBy(Filter(PieChartList,Title = "Week1"),"Question","SubGrp"),"Count",CountRows(SubGrp))
 
PieChartList is the name of my SharePoint list.
and select the Labels as Questions and Series as Count.
 
I replicated your SharePoint list in my environment and got the pie chart for the same data.
 

MicrosoftTeams-image (77).png
Hope this Helps
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Pie Charts from Sharepoint List

There is probably a more elegant way to do this, but here's what works for me.

Create a collection when you start the app using the following:

ClearCollect(ImportData,{Color:"Red",Count:CountRows(Filter(Test,Color = "Red" && Title="Week1"))},{Color:"Blue",Count:CountRows(Filter(Test,Color = "Blue" && Title="Week1"))},{Color:"Green",Count:CountRows(Filter(Test,Color = "Green" && Title="Week1"))})

This creates a collection with a simple table of tabulated results that meet your requreiments.  Then simply bind that collection to the chart.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Dual Super User
Dual Super User

Re: Pie Charts from Sharepoint List

@The_General 

 

Please use the below expression in your Pie Chart Items:
 
AddColumns(GroupBy(Filter(PieChartList,Title = "Week1"),"Question","SubGrp"),"Count",CountRows(SubGrp))
 
PieChartList is the name of my SharePoint list.
and select the Labels as Questions and Series as Count.
 
I replicated your SharePoint list in my environment and got the pie chart for the same data.
 

MicrosoftTeams-image (77).png
Hope this Helps
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

The_General
Level: Powered On

Re: Pie Charts from Sharepoint List

This worked a treat - thank you so much!

Helpful resources

Announcements
thirdimage

Power Platform 24

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,576)