cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Group all the same value in chart, and sum up the value

Hi, 

 

I would like to create a Pie Chart, that can

  • group all the same value, that is "department", in a Pie
  • sum up all "quantity" within a department and display in Pie Chart

However, the Pie Chart shows a lot of pies even they are the same department

Q21a.PNG

Anybody can help?

Thanks in advance

Sam

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @samsam ,

Do you want to group up the "department" column in your SQL Table and then sum up all "quantity" value within individual department?

 

Based on the needs that you mentioned, I think the GroupBy fuunction and AddColumns function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Pie Chart control to following:

AddColumns(
           GroupBy('[dbo].[LeaveApplication]', "department", "GroupData"),
           "totalQuantity",
           Sum(GroupData, quantity)
)

Set the Labels property to department, set the Series property to totalQuantity.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support
Community Support

Hi @samsam ,

Do you want to group up the "department" column in your SQL Table and then sum up all "quantity" value within individual department?

 

Based on the needs that you mentioned, I think the GroupBy fuunction and AddColumns function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Pie Chart control to following:

AddColumns(
           GroupBy('[dbo].[LeaveApplication]', "department", "GroupData"),
           "totalQuantity",
           Sum(GroupData, quantity)
)

Set the Labels property to department, set the Series property to totalQuantity.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-xida-msft  thanks a lot ~~ it works perfectly 🙂

Worked Perfectly...! Thanks.

@v-xida-msft Thanks so much! Have been stuck on this for hours, but solved now 💪!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (37,764)