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):
Columns | Data types |
---|---|
First Name | Single line of text (This is a Title column, I just renamed it to First Name) |
Surname | Single line of text |
Registration ID | Number |
Apply Date | Date and time |
Additionally, as seen in the screenshot below, this list contains some records.
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].
- 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,
- FirstDate, LastDate = Scope Variable Names
- ‘Job Seekers Registration List‘ = SharePoint List Name
- ‘Apply Date‘ = SharePoint Date Column
This is how to work with Power Apps Filter Gallery By the Current Quarter.
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“.
- 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,
- FirstDate, LastDate = Scope Variable Names
- ‘Job Seekers Registration List‘ = SharePoint List Name
- ‘Apply Date‘ = SharePoint Date Column
Refer to the screenshot below.
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.
- 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,
- FirstDate, LastDate = Scope Variable Names
- 2 * 2 = I want next two-quarter records, so I specified 2.
- ‘Job Seekers Registration List‘ = SharePoint List Name
- ‘Apply Date‘ = SharePoint Date Column
This is all about Power Apps Filter Gallery By Next N Quarters.
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“.
- 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,
- FirstDate, LastDate = Scope Variable Names
- ‘Job Seekers Registration List‘ = SharePoint List Name
- ‘Apply Date’ = SharePoint Date Column
Refer to the image below.
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.
- 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,
- FirstDate, LastDate = Scope Variable Names
- 2 * 2 = I want the last two-quarter records, so I specified 2.
- ‘Job Seekers Registration List‘ = SharePoint List Name
- ‘Apply Date’ = SharePoint Date Column
This is how to work with Power Apps Filter Gallery By Last N Quarters.
Also, you may like some more Power Apps tutorials:
- Power Apps Collection Distinct Filter [With Different Data Types]
- Power Apps Filter Gallery By Year [With Real Examples]
- Power Apps Filter Gallery By Last Month [With Various Examples]
- Power Apps Filter Gallery By Date [With Examples]
- Power Apps Filter Gallery By Last Week [With Various Scenarios]
- Power Apps Gallery Conditional Formatting [With 11 Examples]
- Power Apps Sequence Function [With Various Examples]
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
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com