So I have a library in SharePoint, about 13 entries for now.
I am trying to chart how many times each person submitted an entry.
one of the contributors might submit 4 entries and another only 1.
I need to create a column chart to graph their contributions.
so for an example:
ID Contributor Contribution
1 RoyGad money
2 RoyGad Support
3 Joe money
4 mike ride
5 mike books
6 steve network
7 Joe snakes
8 RoyGad drinks
first step i need to create a collection of the distinct names (each contributor is an object with displayname, email, address,...)
then in the second column how many times the name occured in the library.
then graph the result.
This is the last challenge in my project. I would apprecite all the help. I have been trying for 2 days.
Solved! Go to Solution.
I totally missed that it was a Person data type. Here's the code segment that needs correcting. I also corrected it above in the full solution. Make sure to delete/readd the chart after modifying the code.
ClearCollect(myContributors,
Distinct(AddColumns(myCampaign"FullName",Contributor.DisplayName),FullName))
);
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Assuming your datasource looks like this
ClearCollect(myCampaign,
{ID:1, Contributor: RoyGad, Contribution: "money"},
{ID:2, Contributor: RoyGad", Contribution: "Support"},
{ID:3, Contributor: Joe, Contribution: "money"},
{ID:4, Contributor: mike, Contribution: "ride"},
{ID:5, Contributor: mike, Contribution: "books"},
{ID:6, Contributor: steve, Contribution: "network"},
{ID:7, Contributor: Joe, Contribution: "snakes"},
{ID:8, Contributor: RoyGad, Contribution: "drinks"}
);
We need to do a few further operations to get the 2 columns necessary for the Table: Contributor and Count
ClearCollect(myContributors,
Distinct(AddColumns(myCampaign"FullName",Contributor.DisplayName),FullName))
);
ClearCollect(
myChart,AddColumns(myContributors,"Count",CountRows(Filter(myCampaign,Contributor=Result)))
);
Then create a new Bar Chart with these properties
Items: myChart
//these are advanced settings
Labels: Contributor
Series1: Count
Your bar chart will look like this
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Thank you so much mdevaney. I can use the rest of the solution.
but I can't get over the distinct function. I can return all the names in the library as the column is a Person/Group
so what returns is a collection of objects not text.
here is what I tried to do
ClearCollect(names, Ideas.Contributor)
CountRows(names) ==> 13 (Correct)
CountRows(Distinct(names, Contributor)) ==> 1 (Wrong)
Thank you
Roy
I totally missed that it was a Person data type. Here's the code segment that needs correcting. I also corrected it above in the full solution. Make sure to delete/readd the chart after modifying the code.
ClearCollect(myContributors,
Distinct(AddColumns(myCampaign"FullName",Contributor.DisplayName),FullName))
);
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
with some slight modification
ClearCollect(myCampaign, Ideas.Contributor); ClearCollect(myContributors,Distinct(myCampaign,Contributor.DisplayName));ClearCollect(
myChart,AddColumns(myContributors,"Count",CountRows(Filter(myCampaign,Contributor.DisplayName = Result))));Navigate(Analysis)
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
208 | |
71 | |
51 | |
49 | |
20 |
User | Count |
---|---|
264 | |
122 | |
85 | |
80 | |
68 |