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 not calculating co...
Power Apps
Answered

Sum not calculating correctly

(0) ShareShare
ReportReport
Posted on by 1,257 Super User 2024 Season 1

I want to calculate based on one fixed field and another with a varying text. However it is not calculating correctly.   Here is what I am using 

Sum(
 ForAll(
 'MyDataSource',
 Status = "New" And UpdatdStatus = "one" || "two" || "three" || "four" 
 ),
 Value
)

but it will only sum those that are "New" and "one"   not "New and "two" etc.. so the ||  seems to be discounting the first requirement of Status.     

 

How should I word this to calculate all items with the Status of "New"  and then with an UpdatedStatus of one, two,three etc..

 

TIA

Categories:
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    When you are using || (OR), you are saying to the interpreter that

    (status is new and updatdstatus=one)

    or two or three or four

     

    so it doesn't know that you are referring to updatdstatus.

     

    You should format it like this:

    Sum(
     ForAll(
     'MyDataSource',
     Status = "New" And 
     (
     UpdatdStatus = "one" || 
     UpdatdStatus = "two" || 
     UpdatdStatus = "three" || 
     UpdatdStatus = "four"
     )
     ),
     Value
    )
  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    Thanks yeah figured that and have updated but still only calculating the first updated status even doing it as above.. ?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hey, I just realised, you are using a ForAll? but what action are you doing For All of the datasource?

     

    What is the name of the field you are trying to sum?

     

    Are you trying to get a count of the rows where status new and updatdstatus=1/2/3/4?

    If just trying to get the number of rows then:

    CountRows(
     Filter(
     'MyDataSource',
     Status = "New" And 
     (
     UpdatdStatus = "one" || 
     UpdatdStatus = "two" || 
     UpdatdStatus = "three" || 
     UpdatdStatus = "four"
     )
     )
    )
  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    I'm trying to get how many items have a status of new AND an Updated Status of either, one or two or 3..   (counting each of them)

     

    I can't use Countrows as I get a delegation warning plus it says the countrow operation is not supported by this connector..

     

    The forall and sum gets around the delegation issue but it only reads the first Updatedated Status

     

     

     

     

     

  • Verified answer
    vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    Anyway I resolved it.. probably not the cleanest way !  but it gives me the answer I want..

    Sum(
     ForAll(
     'MyDataSource',
     Status = "New" And UpdatdStatus = "one" ||And UpdatdStatus = "two" ||And UpdatdStatus = "three" ||And UpdatdStatus = "four" 
     ),
     Value
    )

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard