Power Apps Filter Gallery By Quarter [With Various Scenarios]

This Power Apps tutorial will assist you in working with Power Apps Filter Gallery By Quarter with various scenarios.

Also, we will see how to filter Power Apps Gallery by Next Quarter, how to filter Power Apps Gallery by Next N Quarters, and many more like:

  • Power Apps Filter Gallery By Current Quarter
  • Power Apps Filter Gallery By Last Quarter
  • Power Apps Filter Gallery By Last N Quarters

Check out Power Apps Gallery Control Examples Download [20 Various Real Scenarios]

Set up a SharePoint List

I have used a SharePoint list Job Seekers Registration List for all the above examples. This list has these many columns (with different data types):

ColumnsData types
First NameSingle line of text (This is a Title column, I just renamed it to First Name)
SurnameSingle line of text
Registration IDNumber
Apply DateDate and time

Additionally, as seen in the screenshot below, this list contains some records.

Power Apps Filter Gallery By Quarter

Now, we will explore all the examples one by one.

Power Apps Filter Gallery By Quarter/Power Apps Filter Gallery By Current Quarter

Now let’s discuss how to filter Power Apps Gallery By the Current Quarter.

  • Since my today’s date is “08/24/2023“, the below Power Apps Gallery filters and displays all the records of the current quarter [from the SharePoint List].
Power Apps Filter Gallery By Current Quarter
  • To do so, select the gallery control and apply the code below on its Items property as:
Items = With(
    {
        FirstDate: Date(
            Year(Today()),
            Month(Today())
            -If(
                Mod(Month(Today())-1,3) = 0,
                0,
                Mod( Month(Today())-1, 3)
            ),
            1
        ),
        LastDate: Date(
            Year(Today()),
            Month(Today()) + 3-Mod(Month(Today())-1,3),
            1
        )-1
    },
    Filter(
        'Job Seekers Registration List',
        'Apply Date' >= FirstDate,
        'Apply Date' <= LastDate
    )
)

Where,

  1. FirstDate, LastDate = Scope Variable Names
  2. Job Seekers Registration List‘ = SharePoint List Name
  3. Apply Date‘ = SharePoint Date Column
Power Apps Filter Gallery By This Quarter

This is how to work with Power Apps Filter Gallery By the Current Quarter.

See also  Power Apps Modern Link Control [Detailed Tutorial]

Power Apps Filter Gallery By Next Quarter

Next, we will see how to filter Power Apps Gallery by next quarter.

  • The below image represents the Power Apps gallery control that displays all the records of the next quarter as the current date is “08/24/2023“.
Power Apps Filter Gallery By Next Quarter
  • To work around with this, select the gallery and set its Items property to the code below:
Items = With(
    {
        FirstDate: Date(
            Year(Today()),
            Month(Today()) - If(
                Mod(
                    Month(Today()) - 1,
                    3
                ) = 0,
                0,
                Mod(
                    Month(Today()) - 1,
                    3
                )
            ) + 3,
            1
        ),
        LastDate: Date(
            Year(Today()),
            Month(Today()) + 3 - Mod(
                Month(Today()) - 1,
                3
            ) + 3,
            1
        ) - 1
    },
    Filter(
        'Job Seekers Registration List',
        'Apply Date' >= FirstDate,
        'Apply Date' <= LastDate
    )
)

Where,

  1. FirstDate, LastDate = Scope Variable Names
  2. Job Seekers Registration List‘ = SharePoint List Name
  3. Apply Date‘ = SharePoint Date Column

Refer to the screenshot below.

Power Apps Gallery Filter By Next Quarter

This is how to work with Power Apps Filter Gallery By the Next Quarter.

Power Apps Filter Gallery By Next N Quarters

Suppose you want to filter the Power Apps Gallery by the next N quarters; the scenario below will help you.

  • Since my current date is “08/24/2023“, the below Power Apps gallery filters and shows the next two-quarter records.
Power Apps Filter Gallery By Next N Quarters
  • To achieve this, apply the formula below on the Gallery’s Items property:
Items = With(
    {
        FirstDate: Date(
            Year(Today()),
            Month(Today()),
            Day(Today())
        ),
        LastDate: Date(
            Year(Today()),
            Month(Today()) + (2 * 2),                         //Specify this number
            Day(Today())
        ) - 1
    },
    Filter(
        'Job Seekers Registration List',
        'Apply Date' >= FirstDate,
        'Apply Date' <= LastDate
    )
)

Where,

  1. FirstDate, LastDate = Scope Variable Names
  2. 2 * 2 = I want next two-quarter records, so I specified 2.
  3. Job Seekers Registration List‘ = SharePoint List Name
  4. Apply Date‘ = SharePoint Date Column
Power Apps Gallery Filter By Next N Quarters

This is all about Power Apps Filter Gallery By Next N Quarters.

See also  Power Apps Filter SharePoint List [25+ Examples]

Power Apps Filter Gallery By Last Quarter

Here, we will see how to work with Power Apps Filter Gallery By Last Quarter or Previous Quarter.

  • The below Power Apps gallery filters and displays all the records of last quarter as my current date is “08/24/2023“.
Power Apps Filter Gallery By Last Quarter
  • To do so, select the gallery control and set its Items property as:
Items = With(
    {
        FirstDate: Date(
            Year(Today()),
            Month(Today()) - If(
                Mod(
                    Month(Today()) - 1,
                    3
                ) = 0,
                0,
                Mod(
                    Month(Today()) - 1,
                    3
                )
            ) - 3,
            1
        ),
        LastDate: Date(
            Year(Today()),
            Month(Today()) + 3 - Mod(
                Month(Today()) - 1,
                3
            ) - 3,
            1
        ) - 1
    },
    Filter(
        'Job Seekers Registration List',
        'Apply Date' >= FirstDate,
        'Apply Date' <= LastDate
    )
)

Where,

  1. FirstDate, LastDate = Scope Variable Names
  2. Job Seekers Registration List‘ = SharePoint List Name
  3. Apply Date’ = SharePoint Date Column

Refer to the image below.

Power Apps Filter Gallery By Previous Quarter

This is how to filter Power Apps gallery by last or previous quarter.

Power Apps Filter Gallery By Last N Quarters

In this scenario, we will discuss how to work with Power Apps Filter Gallery By Last N Quarters.

  • Since my current date is “08/24/2023“, the below Power Apps gallery filters and shows the previous two-quarter records.
Power Apps Filter Gallery By Last N Quarters
  • To achieve this, select the gallery and apply the formula below on its Items property:
Items = With(
    {
        FirstDate: Date(
            Year(Today()),
            Month(Today()) - (2*2),                                    //Specify this number
            Day(Today())
        ) + 1,
        LastDate: Date(
            Year(Today()),
            Month(Today()),
            Day(Today())
        )
    },
    Filter(
        'Job Seekers Registration List',
        'Apply Date' >= FirstDate,
        'Apply Date' <= LastDate
    )
)

Where,

  1. FirstDate, LastDate = Scope Variable Names
  2. 2 * 2 = I want the last two-quarter records, so I specified 2.
  3. Job Seekers Registration List‘ = SharePoint List Name
  4. Apply Date’ = SharePoint Date Column
Power Apps Filter Gallery By Previous N Quarters

This is how to work with Power Apps Filter Gallery By Last N Quarters.

See also  What is Microsoft Dataverse

Also, you may like some more Power Apps tutorials:

This Power Apps tutorial discussed the Power Apps Filter Gallery By Quarter with various scenarios.

Also, we learned how to filter Power Apps Gallery by Next Quarter, how to filter Power Apps Gallery by Next N Quarters, and many more like:

  • Power Apps Filter Gallery By Current Quarter
  • Power Apps Filter Gallery By Last Quarter
  • Power Apps Filter Gallery By Last N Quarters
>