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
Power Participant

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
Power Participant

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.

Power Participant

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.🙂

Helper V

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

#### It's #MPPC23 Week! Check Out the Community Sessions and Events Happening in Vegas

After all the planning and preparing, the annual Microsoft Power Platform Conference is finally here! We are excited to see so many of our community in Las Vegas this week. To help make sure you don't miss any of the workshops, sessions, and events we have planned, make sure to check out this handy Community One-Sheet, and download the pdf today! Make sure to stop by the Community Lounge to meet @hugobernier, @EricArcher, @heaher_italent, and @AshleyFelts from our team! See you in Vegas!