Power Apps Filter A Gallery By Date Range Examples

Power Apps Filter A Gallery By Date Range Examples

Welcome to my Power Apps guide on how to filter a gallery by a date range.

Inside you will find 26 examples of common scenarios filtering a Power Apps gallery by date range. Each page contains code and visuals to show what the code is doing. COPY + PASTE code from the guide into your own app.  Just change the datasource name and column names to match your own.


This guide will grow as I add more examples so be sure to bookmark it!


Basics


Filter A Date Range By Day


Filter A Date Range By Week


Filter A Date Range By Month


Filter A Date Range Quarter


Filter A Date Range By Year




Did You Enjoy This Article?

Subscribe at the bottom of this page to have new articles sent directly to your inbox the moment I post them.


Questions?

If you have any questions or feedback about Power Apps Filter A Gallery By Date Range Examples please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Subscribe
Notify of
guest

30 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Akbar Alam
Akbar Alam
3 years ago

This is very helpful indeed

Ninett Hesse
3 years ago

Just what I was looking for this last month!

Juli
Juli
3 years ago

Very timely! I just needed it today

Jeeten Kumar
Jeeten Kumar
3 years ago

Awesome. This definitely helps. Thank you!.
I have a quick question. How do I get the week number for the current week in canvas app?

moyura
moyura
3 years ago

How would you filter by Name and weekly date range ?

Andre
Andre
2 years ago

I have 2 lists.
1 has the list of cars information about the car with registration plate etc.
2 has a startdate and endate and the selected car numberplate when booked.

I want to have users select a startdate and an enddate. then the gallery should shown only the cars that are available for booking during that datetime period. .

Jacob Swann
Jacob Swann
2 years ago
  • I am trying to use this formula Dates In Previous ‘N’ Months and then have it sort newest items at the top. Having trouble placing the sort function so that it will work.
Jez Holland
Jez Holland
2 years ago

Here is an interesting challenge i am trying to resolve.

I would like a gallery to produce a meeting agenda, the gallery will pull up the form of that specific item and a decision can be added to it directly in the meeting. I have set up the form and the gallery. However filtering that gallery by the current meeting is proving tricky.
I would like a drop down that says something like current meeting, last meeting and next meeting. This then populates a date range to look between so the gallery only populates items for the current meeting.

I have a SP list with the meeting dates in. I am just struggling with the actual doing of it. Any help would be useful.

Dan Vas
Dan Vas
2 years ago

Wonderful – thanks so much!

Iyanuoluwa samson
Iyanuoluwa samson
1 year ago

how do i filter a gallery by todays and upcoming date by clicking on a button

Luke Chalmers
Luke Chalmers
1 year ago

How would I filter by today’s day and month but ignore the year. I want to use this for a sharepoint list named EmployeeBirthdays where the date column is named Birthday. Each employees birthday is entered in mm/dd/yyyy format. I need the gallery to return anyone in the list with todays month and day.

Luke Chalmers
Luke Chalmers
1 year ago

Thank you. I’ll give it a try today and let you know.

Pradipta
Pradipta
1 year ago

any luck for Large list ? When we use filter with Date in Large list Delegation issue is comming.

Kerim
Kerim
8 months ago

Hi Matt,

I have the following situation :

a first gallery with Items set to : ForAll(Sequence(4),{itemLine:Value})
a nested gallery with items set to : ForAll(
  Sequence(13),
  {weekNumber: (ThisItem.itemLine – 1) * 13 + Value}
)

I’d like to show projects with end date occurring in the sequence of the second gallery but I can’t manage to add the filter function to Sequence in Gallery 2.

Any suggestions?

Thank you in advance

Danny DC
Danny DC
7 months ago

Hi Matthew, thank you for this, it is very helpful.
I have still one problem. I have a list with people and in the same list i have a date field (check in). I want to see only those people where the date field is 14, 28, 42, 56, 70, .. days from today’s date.Is this possible?
Below you see the formula i used for just one period of 14 days but i need every 14 days.

SortByColumns(
  With(
    {
      Startdate: Today() – 14, 
      Enddate: Today() – 13
    },
    Filter(
      ‘ListName’,
      ‘ColumnName’ >= Startdate,
      ‘ColumnName’ <= Enddate
    )
  ),
  “Kamer_”,
  SortOrder.Ascending
)

Thanks for helping
Gtz Danny

Scott McKenzie
Scott McKenzie
5 months ago

These were so helpful, Matthew. Thank you.

David
David
1 month ago

helpful but does not tell me how to filter for only missing dates, Datefield is null or datefield is blank.

Spooj
Spooj
19 days ago
Reply to  David

I achieved it by using
Filter(
sharepointList,
If(
!IsBlank(inputFrom.SelectedDate),
sharepointColumnFrom >= inputFrom.SelectedDate,
true
),
If(
!IsBlank(inputTo.SelectedDate),
sharepointColumnTo <= inputTo.SelectedDate,
true
)
)

Johnson
Johnson
13 days ago

Hi Matthew!
My gallery is blank if nothing is in the date picker. How can I show all items if the filter is blank?

The actual filter works when dates are selected, but if no dates then I get a blank gallery.