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
Solution Sage

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
Solution Sage

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.

Solution Sage

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

#### December 2023 User Group Update: Welcoming New Groups and Upcoming Events

A new month means it's time to celebrate and welcome the new user groups that have joined our community. We are excited to announce that we have more than 8 New Groups, which is no surprise after the amazing Microsoft Power Platform Conference. This month, we are breaking them out by the different community categories. If your group is listed here, give this post a kudo so we can celebrate with you! Don't forget to take a look at the many events happening near you or virtually! It's a great time of year to connect and engage with User Groups both locally and online.   Please Welcome Our NEW User Groups   Power Platform: PowerIT User Group: Nottingham Power Platform User Group: Bergen Power Platform User Group: Danmark Nashville Power Platform User Group Microsoft Ambassador Program y Mujer Latina Technolochicas NCWIT Community Copilot Studio:  Copilot User Group Italia Dynamics365: Dynamics User Group AdriaticDynamic 365 Azerbaijan   December User Group Events   01 Dec 2023 Aprendiendo Desarrollo web, creando mi primer power app y power page. 01 Dec 2023 Q4 Hybrid Philadelphia Dynamics 365 & Power Platform User Group Meeting05 Dec 2023APAC Dynamics 365 FastTrack Bootcamp - BI and Analytics07 Dec 2023Bay Area Power Platform Meetup: Learn, Share, and Connect07 Dec 2023Indiana D365/AX December User Group Meeting07 Dec 2023Dynamics User Group Meeting: Houston09 Dec 2023 December '23 - NEW Power Apps User Group Meeting - Online 12 Dec 2023December Cleveland Power Platform User Group Meeting12 Dec 2023 RW2 Data Stewardship Open Forum Discussion 13 Dec 2023  Black Country Power Platform User Group - December 2023 - West Midlands