cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
samsam
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
v-xida-msft
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

5 REPLIES 5
v-xida-msft
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.

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

Worked Perfectly...! Thanks.

Anonymous
Not applicable

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

JGR-Envision
Frequent Visitor

I want to use the same solution, but I need to fileter the statuses: Completed, Pending, Backlogged.

 

I really hope you can help 🙂

 

AddColumns(
    GroupBy(
        'All Projects',
        "Status",
        "GROUPDATA"
    ),
    "totalQuantity",
    Sum(
        GROUPDATA,
        ID
    )
)
 
 
I tried something like this: 
 
AddColumns(
    GroupBy(
        'All Projects',
        Filter("Status"=Pending),
        "GROUPDATA"
    ),
    "totalQuantity",
    Sum(
        GROUPDATA,
        ID
    )
)
)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,623)