Power Apps Filter Gallery By Dates In Last Quarter

Filter a Power Apps gallery to show only dates in the last quarter.



Input

Calendar Dates is a SharePoint list with consecutive days starting 1/1/2018 and ending 12/31/2024 (2,557 rows)

TitleCalendarDate
Monday, January 1, 20181/1/2018
Tuesday, January 2, 20181/2/2018
Wednesday, January 3, 20181/3/2018
Thursday, January 4, 20181/4/2018
Friday, January 5, 20181/5/2018
Tuesday, December 31, 202412/31/2024


Code

Use this code in the Items property of a gallery.

With(
    {
        StartDate: Date(
            Year(Today()),
            Month(Today())
            -If(
                Mod(Month(Today())-1,3) = 0,
                0,
                Mod( Month(Today())-1, 3)
            )-3,
            1
        ),
        EndDate: Date(
            Year(Today()),
            Month(Today()) + 3-Mod(Month(Today())-1,3)-3,
            1
        )-1
    },
    Filter(
        'Calendar Dates',
        CalendarDate >= StartDate,
        CalendarDate <= EndDate
    )
)


Output

Gallery shows only rows with a date in the last month. Current date is 6/16/2021.

TitleCalendarDate
Friday, January 1, 20211/1/2021
Saturday, January 2, 20211/2/2021
Sunday, January 3, 20211/3/2021
Monday, January 4, 20211/4/2021
Tuesday, January 5, 20211/5/2021
Wednesday, January 6, 20211/6/2021
Thursday, January 7, 20211/7/2021
Friday, January 8, 20211/8/2021
Saturday, January 9, 20211/9/2021
Sunday, January 10, 20211/10/2021
Monday, January 11, 20211/11/2021
Tuesday, January 12, 20211/12/2021
Wednesday, January 13, 20211/13/2021
Thursday, January 14, 20211/14/2021
Friday, January 15, 20211/15/2021
Saturday, January 16, 20211/16/2021
Sunday, January 17, 20211/17/2021
Monday, January 18, 20211/18/2021
Tuesday, January 19, 20211/19/2021
Wednesday, January 20, 20211/20/2021
Thursday, January 21, 20211/21/2021
Friday, January 22, 20211/22/2021
Saturday, January 23, 20211/23/2021
Sunday, January 24, 20211/24/2021
Monday, January 25, 20211/25/2021
Tuesday, January 26, 20211/26/2021
Wednesday, January 27, 20211/27/2021
Thursday, January 28, 20211/28/2021
Friday, January 29, 20211/29/2021
Saturday, January 30, 20211/30/2021
Sunday, January 31, 20211/31/2021
Monday, February 1, 20212/1/2021
Tuesday, February 2, 20212/2/2021
Wednesday, February 3, 20212/3/2021
Thursday, February 4, 20212/4/2021
Friday, February 5, 20212/5/2021
Saturday, February 6, 20212/6/2021
Sunday, February 7, 20212/7/2021
Monday, February 8, 20212/8/2021
Tuesday, February 9, 20212/9/2021
Wednesday, February 10, 20212/10/2021
Thursday, February 11, 20212/11/2021
Friday, February 12, 20212/12/2021
Saturday, February 13, 20212/13/2021
Sunday, February 14, 20212/14/2021
Monday, February 15, 20212/15/2021
Tuesday, February 16, 20212/16/2021
Wednesday, February 17, 20212/17/2021
Thursday, February 18, 20212/18/2021
Friday, February 19, 20212/19/2021
Saturday, February 20, 20212/20/2021
Sunday, February 21, 20212/21/2021
Monday, February 22, 20212/22/2021
Tuesday, February 23, 20212/23/2021
Wednesday, February 24, 20212/24/2021
Thursday, February 25, 20212/25/2021
Friday, February 26, 20212/26/2021
Saturday, February 27, 20212/27/2021
Sunday, February 28, 20212/28/2021
Monday, March 1, 20213/1/2021
Tuesday, March 2, 20213/2/2021
Wednesday, March 3, 20213/3/2021
Thursday, March 4, 20213/4/2021
Friday, March 5, 20213/5/2021
Saturday, March 6, 20213/6/2021
Sunday, March 7, 20213/7/2021
Monday, March 8, 20213/8/2021
Tuesday, March 9, 20213/9/2021
Wednesday, March 10, 20213/10/2021
Thursday, March 11, 20213/11/2021
Friday, March 12, 20213/12/2021
Saturday, March 13, 20213/13/2021
Sunday, March 14, 20213/14/2021
Monday, March 15, 20213/15/2021
Tuesday, March 16, 20213/16/2021
Wednesday, March 17, 20213/17/2021
Thursday, March 18, 20213/18/2021
Friday, March 19, 20213/19/2021
Saturday, March 20, 20213/20/2021
Sunday, March 21, 20213/21/2021
Monday, March 22, 20213/22/2021
Tuesday, March 23, 20213/23/2021
Wednesday, March 24, 20213/24/2021
Thursday, March 25, 20213/25/2021
Friday, March 26, 20213/26/2021
Saturday, March 27, 20213/27/2021
Sunday, March 28, 20213/28/2021
Monday, March 29, 20213/29/2021
Tuesday, March 30, 20213/30/2021
Wednesday, March 31, 20213/31/2021