cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimboSey
Helper V
Helper V

Use two date pickers to show the following statistics

Hi, 

 

So I have a Maintenance App linked to a SharePoint list. I have been asked to build in some simple stats and I'd like to implement these into the App.

 

I have two date pickers in my App, called Start_Date and End_Date, I would like to use these to show the following totals in some labels on screen;

 

Label1, to show the total number of items submitted (using the date from 'Created' column), between the dates selected on the two date pickers.

 

Label2, to show the number of items marked 'Complete' between the two date pickers selected values. (The 'Complete' is from a choice column called Status, I have a date column to acknowledge the date the item was marked complete).

 

Label3, Number of outstanding items, so from the Status choice column, I have 'Not Started', I'n Progress' and 'Complete'. I'd like to show the total number of Not Started, and In Progress, marked items between whatever dates I select in the two date pickers.

 

Any help greatly appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @JimboSey ,

Label 1

With(
   {
      wList:
	  Filter(
         ListName,
         Created >= DatePickerFromName.SelectedDate &&
         Created <= DatePickerToName.SelectedDate
      )
   },
   CountRows(wList)
)

Label 2

With(
   {
      wList:
      Filter(
         ListName,
         Created >= DatePickerFromName.SelectedDate &&
         Created <= DatePickerToName.SelectedDate &&
         Status.Value = "Complete"
      )
   },
   CountRows(wList)
)

Label 3

With(
   {
      wList:
      Filter(
         ListName,
         Created >= DatePickerFromName.SelectedDate &&
         Created <= DatePickerToName.SelectedDate &&
         (Status.Value = "Not Started" || Status.Value = "In Progress")
      )
   },
   CountRows(wList)
)

 

Please click Accept as solution 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 Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @JimboSey ,

Label 1

With(
   {
      wList:
	  Filter(
         ListName,
         Created >= DatePickerFromName.SelectedDate &&
         Created <= DatePickerToName.SelectedDate
      )
   },
   CountRows(wList)
)

Label 2

With(
   {
      wList:
      Filter(
         ListName,
         Created >= DatePickerFromName.SelectedDate &&
         Created <= DatePickerToName.SelectedDate &&
         Status.Value = "Complete"
      )
   },
   CountRows(wList)
)

Label 3

With(
   {
      wList:
      Filter(
         ListName,
         Created >= DatePickerFromName.SelectedDate &&
         Created <= DatePickerToName.SelectedDate &&
         (Status.Value = "Not Started" || Status.Value = "In Progress")
      )
   },
   CountRows(wList)
)

 

Please click Accept as solution 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 Thumbs Up.

Visit my blog Practical Power Apps

JimboSey
Helper V
Helper V

@WarrenBelz 

 

Worked perfect, exactly what I needed. Thank you.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,668)