Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Get Count of Date Fields and Text field

(0) ShareShare
ReportReport
Posted on by 307
Hello,

I have 5 date fields and 2 Text field. When this fields are updated my status field gets updated as below:

If T Date is updated - Status shows as 1
If V Date is updated - Status shows as 2
If R1 Date and R Number is updated - Status shows as 3
If R2 Date is updated - Status shows as 4
If R3 Date and R1 Number is updated - Status shows as 5
 
I need to have 4 buttons, were it should show count as below:
When T Date is entered and were V Date is blank, show Count how many V Date are blanks
When T Date, V Date is entered and were R1 Date and R Number is blank, show Count how many R1 Date and R Number are blanks
When T Date, V Date, R1 Date and R Number are entered, show Count of how many R2 Date are blanks
When T Date, V Date, R1 Date, R Number, R2 Date are entered, show Count of how many R3 Date and R1 number are blanks
 
Secondly, I also have a drop down field named as Category, which has Class 1 and Class 2 options
For this I need to create 2 buttons based on this Category field i.e. Class 1 and Class 2

 
Now when Class 1 button is clicked, show counts of Class 1
Now when Class 2 button is clicked, show counts of Class 2
 
And when none of the buttons are clicked, show all counts
 
Please advise on how can be achieve the above.
 
Once this is achieved, I will need to filter my Gallery, which I will explain in the requirement later
  • WarrenBelz Profile Picture
    147,509 Most Valuable Professional on at
    Get Count of Date Fields and Text field
    I am not sure how that answers what I posted (the data source is not relevant). What else happens when the buttons are pushed? If nothing and you simply wanting the relevant totals as per my structure posted, you would set a Variable on each button push and show these totals with some If/And rules on the Visible property of the control. Can you firstly explain the current button click process and how (if at all) all the other information you have included is relevant.
  • Prem4253 Profile Picture
    307 on at
    Get Count of Date Fields and Text field
     
    It was just an example to show in excel.
     
    My actual data source is SharePoint list 
  • WarrenBelz Profile Picture
    147,509 Most Valuable Professional on at
    Get Count of Date Fields and Text field
    Unless I am misreading here (which is possible), you have asked a very simple question in a very complex manner. If you are after the count on blank cells in different fields, it would be (example)
    CountRows(
       Filter(
          Table,
          'R1 Date' = Blank()
       )
    )
    and the same for the other columns. I am assuming here that when the buttons are clicked, the data source is updated and you then want the totals.
    On a related matter, if you are using Excel, it is really the "Data Source of last resort" and you can expect things that should work not to do so, particularly as the records grow in numbers. If you have access to SharePoint Lists, I would urge you to change to them.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee 
     
  • Prem4253 Profile Picture
    307 on at
    Get Count of Date Fields and Text field
     
    Apologize on getting you confused.
    I have a form as well Gallery with the app.
     
    When Class 2 is selected from Category dropdown, Status field shows as update V Date and once the V date is added, status changes to Closed
     
    Tricky is about the Class 1 Category:
     
    When Class 1 is selected from Category dropdown, Status field shows as update V Date
    When V date is added - status changes to Update R1 Date / R Number
    When R1 Date and  R Number is added - status changes to Update R2 Date
    When R2 Date is added - status changes to Update R3 Date and R1 Number
    When R3 Date and R1 Number is updated - status changes to Closed
     
     
    Now in column C there are total 7 blanks, so In Button 1 (V Date) it should show 7 as the count
    But when we click on Class 1 Button, the count should reflect as 3 and when clicked on Class 2, count should reflect as 4
    Similarly the count results should also reflect in the Gallery as per Class 1 and Class 2 button clicks (we can focus on this later)
     
    Next - say one of the user added dates in C6 and C7, so the Counts will be as below:
    Class 1 button - 3
    Class 2 button - 2
     
    Basically I'm looking to get the counts of all the blanks from column C, D, F and G as mentioned in my #2 post
     
    We should have 4 buttons as below:
     
    Let me know if it's confusing and I can amend the post
     
  • WarrenBelz Profile Picture
    147,509 Most Valuable Professional on at
    Get Count of Date Fields and Text field
    I have read both of your posts several times and am probably more confused than before I started. Is that a Form or a Gallery and what exactly is the count you are referring to ? If a Gallery, what if different records have different content and how do you want this result displayed ? I am equally unclear on how the buttons "show" the counts.
  • Prem4253 Profile Picture
    307 on at
    Get Count of Date Fields and Text field
    I'm providing more clarification about the requirement with below screen shot on how my app looks.
     
    Grey buttons to show the Counts and Green button is Category dropdown
     
    And this is how my Status fields works:
     When all the fields are blank (Blue one's) - status shows as T Day
     When T date is added - status changes to Update V Date
     When V date is added - status changes to Update R1 Date / R Number
     When R1 Date and  R Number is added - status changes to Update R2 Date
     When R2 Date is added - status changes to Update R3 Date and R1 Number
     When R3 Date and R1 Number is updated - status changes to Closed
     
    Say for example as of now I have only 1 entry in my form
    When V Date is Blank - Count for button 1 will be 1
    When V Date is added but R1 Date and R Number is blank - Count for button 2 will be 1 and for V Date count will become 0
    When V Date, R1 Date, R number are added - count for button 3 will be 1 and button 1 and 2 will be 0
    When V Date, R1 Date, R number, R2 date are added - count for button 4 will be 1 and button 1, 2 and 3 will be 0
     
    And on click of Class 1 and Class 2 buttons, it should show all the counts were we have blanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 479 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 197

#3
stampcoin Profile Picture

stampcoin 166

Overall leaderboard