cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Count matching column values in a record

Here is a simplified version of my scenario.

 

I have a list with the following columns - Title, PE1, PE2, PE3, PE4, PE5 - where the PE fields are number fields with possible values between 0 and 5.

 

For each record when it is open in the app I want to count how many of these PE fields have a value of 0 and save that to a variable.  I save the record when selected from the gallery as a variable (varRecord) and I could throw it in a collection I guess if that would help or allow CountIf to function but I'm not sure the best way to proceed.

 

Thanks, Ed

3 REPLIES 3
Super User III
Super User III

@edbellman 
If you put this code in a label it will show how many of the columns are blank.  I do not know of a more elegant way.

  

 If(varRecord.PE1=0, 1)
+If(varRecord.PE2=0, 1)
+If(varRecord.PE3=0, 1)
+If(varRecord.PE4=0, 1)
+If(varRecord.PE5=0, 1)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaney  Thanks, Matt.  I was trying to avoid this as my real application has 18 "PE" type fields but maybe that is the best option.

@edbellman 
Unfortunately, it is the only option... can you please accept as solution?

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (69,868)