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

#### Copilot Cookbook Challenge | WINNERS ANNOUNCED | Win Tickets to the Power Platform Conference

We are excited to announce the "The Copilot Cookbook Community Challenge random winners have been selected for the Challenge.  Thank you to everyone who participated in this challenge.    Copilot Cookbook Gallery:Power Apps Cookbook Gallery: 1. @swaminawale  1. @renatoromao     2.  @SpongYe  2.   @nickpotts10  *Please note if for any reason a winner declines, we will have another random drawing.   Check out all of the Cookbook Submissions: 1. Copilot Studio Cookbook Gallery: https://aka.ms/CS_Copilot_Cookbook_Challenge 2. Power Apps Copilot Cookbook Gallery: https://aka.ms/PA_Copilot_Cookbook_Challenge   There will be 5 chances to qualify for the final drawing: Early Bird Entries: March 1 - June 2Week 1: June 3 - June 9Week 2: June 10 - June 16Week 3: June 17 - June 23Week 4: June 24 - June 30WINNERS ANNOUNCED - JULY 8th     At the end of each week, we will draw 5 random names from every user who has posted a qualifying Copilot Studio template, sample or demo in the Copilot Studio Cookbook or a qualifying Power Apps Copilot sample or demo in the Power Apps Copilot Cookbook. Users who are not drawn in a given week will be added to the pool for the next week. Users can qualify more than once, but no more than once per week. Four winners will be drawn at random from the total qualifying entrants. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once. If they are drawn multiple times, another user will be drawn at random. Prizes:  One Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 (\$1800 value, does not include travel, lodging, or any other expenses) Winners are also eligible to do a 10-minute presentation of their demo or solution in a community solutions showcase at the event. To qualify for the drawing, templates, samples or demos must be related to Copilot Studio or a Copilot feature of Power Apps, Power Automate, or Power Pages, and must demonstrate or solve a complete unique and useful business or technical problem. Power Automate and Power Pagers posts should be added to the Power Apps Cookbook. Final determination of qualifying entries is at the sole discretion of Microsoft. Weekly updates and the Final random winners will be posted in the News & Announcements section in the communities on July 29th, 2024. Did you submit entries early?  Early Bird Entries March 1 - June 2:  If you posted something in the "early bird" time frame complete this form: https://aka.ms/Copilot_Challenge_EarlyBirds if you would like to be entered in the challenge. Early Bird Submissions: @renato Week 1 Results:  Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Copilot Cookbook Gallery:Power Apps Cookbook Gallery:1.  @Mathieu_Paris 1.   @SpongYe 2.  n/a2.   @Deenuji 3.  n/a3.   @Nived_Nambiar  4.  n/a4.   @ManishSolanki 5.  n/a5.    n/a   Week 2 Results:  Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Copilot Cookbook Gallery:Power Apps Cookbook Gallery:1. Kasun_Pathirana1. ManishSolanki2. cloudatica2. madlad3. n/a3. SpongYe4. n/a4. n/a5. n/a5. n/a     Week 3 Results:  Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Copilot Cookbook Gallery:Power Apps Cookbook Gallery:1. Parul_Yadav_Neo1. n/a2. SpongYe2. n/a3. n/a3. n/a4. n/a4. n/a5. n/a5. n/a   Week 4 Results:  Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Copilot Cookbook Gallery:Power Apps Cookbook Gallery:1. @nickpotts10  1. @ShrushtiShah  2. @Suniti_0020 2. @swaminawale 3. n/a3. @farukhis786 4. n/a4. @ManishSolanki  5. n/a5.  n/a