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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

How to SUM Gallery selected items

(0) ShareShare
ReportReport
Posted on by 327

Hi all

 

how do I SUM when a drop-down is selected on a gallery? code below giving errors

 

Thank you all

 

Sum(Gallery1.AllItems,
 If(
 !IsBlank(ddAnt.Selected.Value),
 1
 ),
 If(
 !IsBlank(ddNew.Selected.Value),
 1
 ),
 If(
 !IsBlank(ddSix.Selected.Value),
 1
 ),
 If(
 !IsBlank(ddThree.Selected.Value),
 1
 ),
 If(
 !IsBlank(ddAdhoc.Selected.Value),
 1
 ),
 If(
 !IsBlank(ddCase.Selected.Value),
 1
 )
)

  

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    151,881 Most Valuable Professional on at
    Re: How to SUM Gallery selected items

    Hi @moerah ,

    Try this

    CountRows(
     Filter(
     Gallery1.AllItems,
     !IsBlank(ddAnt.Selected.Value) || 
     !IsBlank(ddNew.Selected.Value) ||
     !IsBlank(ddSix.Selected.Value) ||
     !IsBlank(ddThree.Selected.Value) ||
     !IsBlank(ddAdhoc.Selected.Value) ||
     !IsBlank(ddCase.Selected.Value)
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • moerah Profile Picture
    327 on at
    Re: How to SUM Gallery selected items

    This works great for an individual column in a gallery

     

    how ever I wanted to add all columns so I used this coding instead (may not be best practice for coding but it works)

    CountRows(
     Filter(
     Gallery1.AllItems,
     !IsBlank(ddAnt.Selected.Value)))+
     CountRows(
     Filter(
     Gallery1.AllItems,
     !IsBlank(ddNew.Selected.Value)))+
     CountRows(
     Filter(
     Gallery1.AllItems,
     !IsBlank(ddSix.Selected.Value)))+
     CountRows(
     Filter(
     Gallery1.AllItems,
     !IsBlank(ddThree.Selected.Value)))+
     CountRows(
     Filter(
     Gallery1.AllItems,
     !IsBlank(ddAdhoc.Selected.Value)))+
     CountRows(
     Filter(
     Gallery1.AllItems,
     !IsBlank(ddCase.Selected.Value)))

     thank you for your support @WarrenBelz  

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 663 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 398 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 235

Last 30 days Overall leaderboard