cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BT168
Microsoft
Microsoft

Sum of entries in a particular column into gallery or pie chart

Hi, 

 

I have a powerapp where users are asked to select the team they're in (choice column in SP list) and then input a number of miles they have walked. 

 

What I want to do is display the sum of those miles per team in a leaderboard type gallery or chart. 

 

I know for pie charts they don't allow for a 'choice' column to be one of the fields the data is pulled from but I'm struggling to work out how to do it in a blank vertical gallery too. 

 

I have managed to find the sum of miles for an individual: 

Sum(Filter(MilesChallenge,Title=ThisItem.Title),Miles) & " Miles"

 

My question is how can I filter it by team rather than individual? 

 

If someone could help me with how to put it in a pie chart that would be ideal! 

 

Thanks

7 REPLIES 7
mdevaney
Super User
Super User

@BT168 
You can do this by adding .Value to the end of the Choices column name.

Sum(Filter(MilesChallenge,Team.Value=ThisItem.Team.Value),Miles) & " Miles"

 

 ---
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."

Thanks @mdevaney however nothing is coming up. 

 

Within my blank gallery i have two labels, and the first label is not pulling through the choices. Is there something I'm missing? 

 

1st label: 

ThisItem.Team.Value
 
2nd Label: 
Sum(Filter(MilesChallenge,Team.Value=ThisItem.Team.Value),Miles) & " Miles"

@BT168 
Do you actually have a Choices column named Team?  Make sure to use your own column name: not the one I provided.  It was just an example.

@mdevaney yes I do, its called Team in my SP list

@BT168 
Type this code in the label and see what auto-complete suggests. Make sure to include the period.

ThisItem.Team.

 

---
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."

@mdevaney 

 

So that worked when I put in ThisItem.Team.Value (just needed a refresh) but instead of showing all the teams in the choices list on the gallery, it just shows a lengthy blank gallery even when I have tested putting in entries selecting different teams: 

Don't know if the screenshot shows clearly what I mean. 

 

BT168_0-1601645150802.png

 

@BT168 
Try changing the TemplateHeight property of the Gallery to something smaller like 70.

 

---
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."

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,571)