cancel
Showing results for
Did you mean:
Helper V

## Multiple Count if based on Drop Down selection on Power apps

Hi Can any one pls help me on this, i am new to PowerApps and creating a form on PowerApps which is link from Sharepoint List. as Sharepoint don't have count if function available.

I have drop 3 Dropdown boxes, based on the selection on the 3 dropdowns, 4 column should give the result.

e.g. Count If(Dropdown1 ="Yes"+Dropdown2 ="No"+Dropdown2 ="Yes")/3

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Just use parens and do the division:

``(If(dd1.Selected.Value="yes",1,0) + If(dd2.Selected.Value="yes",1,0) + If(dd3.Selected.Value="yes",1,0))/3``

Or, to get it formatted as a percent, you can use the "text" function:

``Text((If(dd1.Selected.Value="yes",1,0) + If(dd2.Selected.Value="yes",1,0) + If(dd3.Selected.Value="yes",1,0))/3*100,"0%")``
5 REPLIES 5
Super User

You want to count how many dropdowns have yes?

``If(dd1.Selected.Value="yes",1,0) + If(dd2.Selected.Value="yes",1,0) + If(dd3.Selected.Value="yes",1,0)``

In the above, each if statement generates a 1 or 0, depending on the value of the dropdown, then it just adds these together.

Helper V

Thanks However i have to take the count of yes then Divide by 3, how will show the value in percent in 4 box depending on the count of Yes.

Super User

Just use parens and do the division:

``(If(dd1.Selected.Value="yes",1,0) + If(dd2.Selected.Value="yes",1,0) + If(dd3.Selected.Value="yes",1,0))/3``

Or, to get it formatted as a percent, you can use the "text" function:

``Text((If(dd1.Selected.Value="yes",1,0) + If(dd2.Selected.Value="yes",1,0) + If(dd3.Selected.Value="yes",1,0))/3*100,"0%")``
Helper V

Thank you so much it solved my purpose.🙂

Anonymous
Not applicable

Hi,

I have tried using this same code, but it has not worked for me.

As you can see below, each different MIR Number info is a different row of data in my SharePoint list. However, within eventhough each of those SharePoint Lists have a different number of dropdowns that say Yes and No, meaning they should all have different numbers. However, as you can see, they all say 1. It seems to use the number of whatever SharePoint data row I was editing in the app. But it should have different numbers for each one.

Not sure why this is, can anyone help?

Thanks in advance for any help.

Announcements

#### Celebrating the May Super User of the Month: Laurens Martens

@LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!