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

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

On the Gallery, change the formula to:

Filter(AddColumns('Sharepoint1',"Cost",LookUp(Cost,Title='Sharepoint1'[@Equipment],Cost)), Contact = User().FullName)

 

Then in your Label:

Sum(Gallery1.AllItems,Cost)

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

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.

Consider Checking My Youtube Channel

 

View solution in original post

22 REPLIES 22
eka24
Super User
Super User

Filter the Gallery, so on the Items property:

Filter(Cost, name=User().FullName)

 

Then in the Text property of your Label:

Sum(Gallery_Myitems.AllItems,CostColumn)
------------

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.
StalinPonnusamy
Community Champion
Community Champion

Syntax

 

Sum(Filter(Datasource, Condition), ColumnName)

 

Example

 

Sum(BrowseGallery1.AllItems,Cost)

 

StalinPonnusamy_0-1626793301078.png

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

Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful.

@eka24 

Thank you so much for your reply. 

My apologies. The gallery is connected to a different sharepoint list, so the items property is already in use. 

How could I get round this please?

StalinPonnusamy
Community Champion
Community Champion

Hi @pricey79 

We are using the label text property only to display the sum

StalinPonnusamy_0-1626793647182.png

 

@StalinPonnusamy Thank you for your reply, but I get the following error with that:

 

pricey79_0-1626793813906.png

 

Can you state / show the code on the items property of the Gallery?

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

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.

Consider Checking My Youtube Channel

 

 

@eka24 

Filter('Sharepoint list 2', Contact = User().FullName)

eka24
Super User
Super User

If I understand you, we are dealing with 2 Tables. Do they have any column in common?

It seems you are summing the other table based on what you have filtered?

If so, can you tell any common column between the 2 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.

Consider Checking My Youtube Channel

 

StalinPonnusamy
Community Champion
Community Champion

@pricey79  As I showed, I'm displaying sum on the label text property.

 

Where you are displaying the sum?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

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