Hi,
I have a sharepoint list as below:
Ref# Stage Description
Ref1 In Progress Some description
Ref2 Completed Some description
Ref3 On-hold Some description
and so on
Here, Stage is a choice column
I want to create a pie chart as below:
So basically in the pie chart i want to show the count of Stages
Any help would be greatly appreciated.
Solved! Go to Solution.
Hi @TheOpeningBat ,
The formula provided by @rubin_boer already including the count column. So you just need to set the Legend control to use the count result.
To make it clearly, you can keep the result into a collection:
ClearCollect(varchart,AddColumns(GroupBy(MyCollection,"NewFieldForStage","Stages"),"Total",CountRows(Stages)))
Then set the PieChart control to:
varchart.Total
Set Legend control to:
varchart.NewFieldForStage
Best regards,
Allen
Hi @TheOpeningBat add a collection for your SharePoint List. Add a barchart and Set its tems = AddColumns(GroupBy(YourCollection,"Stage","Stages"),"Total",CountRows(Stages)).
It will give you the desired result
Hi @rubin_boer,
Tried as below:
Created a collection on the onVisible event of the screen:
ClearCollect(MyCollection, AddColumns(MySPList, "NewFieldForStage", Stage.Value));
Created a pie chart & on the Items property added the below:
AddColumns(GroupBy(MyCollection,"NewFieldForStage","Stages"),"Total",CountRows(Stages))
However - I am not able to get how to show the Total count of In progress, Completed & On-hold items in the Labels.
I want the Legend as In progress, Completed & On-hold & Labels in the pie chart to show the total count of those items but it is showing the stages - In progress, Completed & On-hold & not the total count.
Am I missing something here. Please help.
Hi @TheOpeningBat ,
The formula provided by @rubin_boer already including the count column. So you just need to set the Legend control to use the count result.
To make it clearly, you can keep the result into a collection:
ClearCollect(varchart,AddColumns(GroupBy(MyCollection,"NewFieldForStage","Stages"),"Total",CountRows(Stages)))
Then set the PieChart control to:
varchart.Total
Set Legend control to:
varchart.NewFieldForStage
Best regards,
Allen
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
164 | |
94 | |
64 | |
62 | |
60 |
User | Count |
---|---|
243 | |
163 | |
94 | |
84 | |
82 |