cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pricey79
Helper IV
Helper IV

Using SUM function help please

Hello everyone, I was hoping someone could help me please

 

I have a Sharepoint list called Cost with 2 columns,  item name and costs 

I have a label in my app, that I would like to show the sum of all costs associated with a gallery that is filtered to the current logged in user.

So for example,  if I were logged in the gallery would show all my items , and I would like the label to show the sum of all item costs.

The gallery is called Gallery_Myitems

 

I then have this on the label, but it doesnt work. I've never used the sum function before so was hoping someone could help please?
Sum(Filter(Costs , Cost ,Gallery_Myitems.AllItems)

 

Thank you in advance

22 REPLIES 22

@StalinPonnusamy 

Same, text

pricey79_0-1626794521340.png

 

@eka24 

Two sharepoint lists 

 

One is a collection from when someone submits something through the app. The other list is a static list of just items and costs.

 

So for example, someone might choose a laptop and a mouse over the next 2 months. The sharepoint list called Costs, has a laptop at £640 and a mouse as £10. When that person is logged on, the gallery should filter by that user to show a laptop and a mouse. The label would then show £650

eka24
Super User
Super User

My question was whether there is any common column (same column) between the 2 tables.

if it not clear, show a screen shot of both tables

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

@eka24 

Apologies., yes there is. 

They both have an equipment column. Although on one its called Title , because sharepoint didnt like me changing it for some reason

@eka24 @StalinPonnusamy   can anyone help please? Thanks

eka24
Super User
Super User

Kindly take a screenshot of the collection and the Table. 

Consider Checking My Youtube Channel

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

@eka24 

This is the Sharepoint list where people add items through a patch in the app:

pricey79_0-1626860085042.png

 

This is the sharepoint list with items and cost:

pricey79_1-1626860139891.png

This is the gallery that filters to the individual who is logged in and what items they have:

With the items property as such : 

Filter('Sharepoint1', Contact = User().FullName)

pricey79_2-1626860207751.png

 

 

KvB1
Solution Specialist
Solution Specialist

All the numbers that you want to Sum are already in the Gallery right? There doesn't seem to be a need to filter it further unless I'm missing something?

Did the column previously have a different name, did you change it at some point? 

Sum(Gallery1.AllItems;Label1)

Should work 

@KvB1 Thank you for your reply

The number I want to sum, i.e the cost of equipment is not in the gallery. The gallery only highlights the items that the person who is logged in, has against their names.  The costs of items are in a separate sharepoint list.

Apologies if i'm not explaining it properly. I'm a basic app creator currently  

KvB1
Solution Specialist
Solution Specialist

With this you are grabbing the value in column Cost from list Costs, for the record where the Title matches the value in the column Equipment from the datasource connected to the gallery. Then it sums that. If this doesnt work try replacing 'Equipment' with the name of the label instead

 

Sum(Gallery_Myitems.AllItems,LookUp(Costs,Title=Equipment).Cost)

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,587)