web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sum and filter collection
Power Apps
Answered

Sum and filter collection

(0) ShareShare
ReportReport
Posted on by 23

Hello

 

I am trying to sum a column in a collection based on the user and the month for a sales team.

 

The collection is colTotalSale and the column to be summed is TotalSale.  

 

Sum(Filter(colTotalSale, Date=Month(Now()), User=User().FullName), TotalSale, thought this would work but sadly not.  Probably spent too much time on it and cant work out what the error is.  

 

Could some fresh eyes point out the obvious to me 🙂

 

Thanks

Categories:
I have the same question (0)
  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @SilvermarD ,

    If you are going to filter by month then you have to use a range. Something like:

     

    Filter(colTotalSale, Date >= Date(Year(Now()),Month(Now()),1), Date <= DateAdd(Date(Year(Now()),Month(Now()),1),1,"Months"), User=User().FullName)

     

     

  • SilvermarD Profile Picture
    23 on at

    Thanks Adrian.

     

    This is throwing up an error, saying the property on this control expects text values.  Tried to make the date range work but cant seem to get it right.

     

     

     

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @SilvermarD 

    Can you show me the formula that you've done so far and what is the error saying exactly?

  • SilvermarD Profile Picture
    23 on at

    Hello Adrian

     

    Thanks for getting back to me.

     

    I tried the filter you sent me but adding in Sale total as this is the information I am trying to extract.  The error was Unexpected characters, formula contains 'ParenClose' where Eof is expected.  Also, invalid argument type (table).  Expecting a number value instead.

     

    Had a look at how to do date ranges and came up with below, however the error with this one is invalid argument type (table).  Expecting a number value instead.

     

    Sum(Filter(colTotalSale, DateDiff("1/1/22", Now()) < 0 && DateDiff(Now(), "31/1/22") > 0), User, Sale_Total)

     

    Thanks

     

     

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @SilvermarD 

     

    If the error is 'ParentClose' then most likely it's missing a parentesis. So what is the 'User' in your formula? Is it filtering out the user? If so then it should be something like:

     

     

     

    Sum(Filter(colTotalSale, DateDiff("1/1/22", Now()) < 0 && DateDiff(Now(), "31/1/22") > 0, User = "Some Name"), Sale_Total)

     

     

     

    Let me know if it works. If not then we'll investigate deeper.

     

  • Verified answer
    SilvermarD Profile Picture
    23 on at

    Fantastic, no errors with the formula.  Unfortunately, its not producing a result, so something is a miss somewhere.

     

    Many thanks

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @SilvermarD 

     

    Ok firstly it will be good if you take it one step at a time. You should determine if your table result is producing any data at all.

    I am not sure about if your filter formula will work but essentially it should look something like this:

     

    Filter(colTotalSale, YourDateColumnName >= Date(2022,1,1) && YourDateColumnName <= Date(2022,2,1))

     

    The formula above should filter out all items on your date column for the month of Jan 2022.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard