cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tianaranjo
Continued Contributor
Continued Contributor

Count items selected

Challenge:

      I have 4 Dropdowns. All have items populating from a collection.  Additionally, I have added a default "-" to each dropdown. 
      I would like to count 'how many' of the dropboxs are populated with a selection excluding the "-" (desired result shown                image)

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @tianaranjo,

 

Since all the Count functions need to count values from Table, to do this, you will need to add a button control and create a collection before counting. Set the  OnSelect property of the button to:

ClearCollect(C,{Test:Dropdown1.Selected.Value},{Test:Dropdown2.Selected.Value},{Test:Dropdown3.Selected.Value},{Test:Dropdown4.Selected.Value})

 

Use below formula on the Text property of the label control to show the count number:

CountIf(C,Test<>"-")

Capture.PNG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-monli-msft
Community Support
Community Support

Hi @tianaranjo,

 

Since all the Count functions need to count values from Table, to do this, you will need to add a button control and create a collection before counting. Set the  OnSelect property of the button to:

ClearCollect(C,{Test:Dropdown1.Selected.Value},{Test:Dropdown2.Selected.Value},{Test:Dropdown3.Selected.Value},{Test:Dropdown4.Selected.Value})

 

Use below formula on the Text property of the label control to show the count number:

CountIf(C,Test<>"-")

Capture.PNG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,198)