cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmazzoni
New Member

Sum a list based on user

Hi Everyone,

 

I am new to this and have not been able to get my app to work by going through the existing posts on this topic - any help is appreciated!

 

I have added a SharePoint list as a data source in my app:

List Name: 'Recognition Program'

Column Name: 'Person Nominated'

Column Name: 'Points Approved'

 

I want to display the total number of points approved for the person who is using the app. I am keeping track of all the nominations and points in this single SharePoint list, so I am trying to filter the list to only look at the entries where the person nominated = the user and then sum the points approved column.

 

Here is the formula I am trying:

Sum(Filter('Recognition Program',Match(Office365Users.MyProfile().DisplayName,'Person Nominated'),'Points Approved'))

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
jmazzoni
New Member

Thanks @rubin_boer !

 

Didn't need the .DisplayName; this is the final working code: 

Sum(Filter('Recognition Program','Person Nominated'=User().FullName),Value('Points Approved'.Value))

View solution in original post

8 REPLIES 8
rubin_boer
Super User
Super User

hi @jmazzoni welcome to the community

 

Please try Sum(Filter('Recognition Program','Person Nominated' = User().FullName),'Points Approved')

 

Hope it helps

 

That removed the error, but I am still not getting a value displayed.

 

Here are the errors/warnings I am seeing now:

  • The function 'Sum' has some invalid arguments.
  • Invalid argument type (Record). Expecting a number value instead. --> I get this when hovering over 'Points Approved'
rubin_boer
Super User
Super User

Please add Value to the Point approved try Sum(Filter('Recognition Program','Person Nominated' = User().FullName),Value('Points Approved'))

 

That removed the 'Sum' error, but still no value being displayed.

 

New errors/warnings:

  • The function 'Value' has some invalid arguments.
  • Expected text or number. We expect text or a number at this point in the formula. --> when hovering over 'Points Approved'
rubin_boer
Super User
Super User

Hi @jmazzoni can you post your data. this is what is what i assume we are working with. User being person nominate din your case

rubin_boer_0-1614960303616.png

 

 

The data comes from the SharePoint List (attached)

 

Trying to get it to display in my app (attached)

rubin_boer
Super User
Super User

there we go @jmazzoni  Sum(Filter('Recognition Program','Person Nominated'.DisplayName = User().FullName),Value('Points Approved'))

and if multiple selection is allowed Sum(Filter('Recognition Program', First('Person Nominated').DisplayName = User().FullName),Value('Points Approved'))

 
jmazzoni
New Member

Thanks @rubin_boer !

 

Didn't need the .DisplayName; this is the final working code: 

Sum(Filter('Recognition Program','Person Nominated'=User().FullName),Value('Points Approved'.Value))

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (39,979)