Hi everyone,
I'm trying to build a bar chart in PowerApps but i can't seem to get it right. I'll explain below:
I have a sharepoint list with two columns:
Departments Category
HR Example1
IT Example 2
Logistics Example 3
.... ....
HR Example2
HR Example3
IT Example1
... ....
I want to display in the chart how many entries for each category does each departments has. Ex: Example1 : HR 36 entries
Can someone share some tips, ideas? Thank you!
Solved! Go to Solution.
Hi @cosmin89 :
I suggest you use the processed data as the items property of the bar chart.I'v made a test for your reference:
1\My data source-MYList
ClearCollect(
MYList,
{Departments:"HR",Category:"Example1"},
{Departments:"IT",Category:"Example2"},
{Departments:"Logistics",Category:"Example3"},
{Departments:"HR",Category:"Example2"},
{Departments:"IT",Category:"Example3"}
)
2\Set the Chart's items property to:
ShowColumns(
AddColumns(
GroupBy(
AddColumns(
MYList,
"Category:Departments",
Category & ":" & Departments
), /*create a new column "Category:Departments"*/
"Category:Departments",
"Group"
),/*group by "Category:Departments"*/
"Numbers",
CountRows(Group)
),/*create a new column "Numbers" and calculate the number of records in each category*/
"Category:Departments",
"Numbers"
)
Best Regards,
Bof
Hi @cosmin89 :
I suggest you use the processed data as the items property of the bar chart.I'v made a test for your reference:
1\My data source-MYList
ClearCollect(
MYList,
{Departments:"HR",Category:"Example1"},
{Departments:"IT",Category:"Example2"},
{Departments:"Logistics",Category:"Example3"},
{Departments:"HR",Category:"Example2"},
{Departments:"IT",Category:"Example3"}
)
2\Set the Chart's items property to:
ShowColumns(
AddColumns(
GroupBy(
AddColumns(
MYList,
"Category:Departments",
Category & ":" & Departments
), /*create a new column "Category:Departments"*/
"Category:Departments",
"Group"
),/*group by "Category:Departments"*/
"Numbers",
CountRows(Group)
),/*create a new column "Numbers" and calculate the number of records in each category*/
"Category:Departments",
"Numbers"
)
Best Regards,
Bof
User | Count |
---|---|
254 | |
106 | |
92 | |
47 | |
37 |