0

I have a Sharepoint list which have a column with a Choice value, I want to show how many times each value is repeated in a Pie Chart on my Power App.
When I select the chart and tell it on the Item properties to read my Sharepoint list data, it only goes green and shows the number of items. Example screenshot:

enter image description here

What I want now is to show the specific column (which is a Choice column) and give each of the options a different color.
I've been investigating and found this link with a formula, but I just can't figure out how it works, because for me is just errors.

Here's the formula from the link:

AddColumns(
  GroupBy(
       AddColumns('20190102_case6',"NewFieldName",Office_Name.Value),
       "NewFieldName",
       "GroupData"
  ),
  "CountByOffice",
  CountRows(GroupData)
)
0

You need to modify every parameter in the formula to correspond to your SharePoint list.

Give the colors you want the pie chart to use under ItemColorSet and write the colors in order. You can copy the colors from the PieChartSample directly.

enter image description here

And here is an example for the formula:

If I want to get a chart that only use Title and Number column values, I use the formula

AddColumns(PieChart, "Account", Number) 

Where PieChart is the source, Account is the custom name for the new column, Number is the formula for getting the values for the Account column.

Then set Title as Labels and Account as Series.

Here is the outcome:

enter image description here

References: GroupBy function. AddColumns function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.