How to Filter Power Apps Gallery by Dates in the Current Month
Want to showcase only the dates of the current month in your Power Apps gallery? Let’s dive in and see how it’s done using a SharePoint list.
Input Data Source
We are using a SharePoint list named “Calendar Dates” which has continuous dates ranging from 1/1/2018 to 12/31/2024, encompassing 2,557 rows in total. Here’s a sneak peek:
Title | CalendarDate |
---|---|
Monday, January 1, 2018 | 1/1/2018 |
Tuesday, January 2, 2018 | 1/2/2018 |
Tuesday, December 31, 2024 | 12/31/2024 |
Code to Filter by Current Month
Implement the following code in the Items property of your gallery:
With(
{
InitDate: Date(
Year(Today()),
Month(Today()),
1
),
TermDate: Date(
Year(Today()),
Month(Today())+1,
1
)-1
},
Filter(
'Calendar Dates',
CalendarDate >= InitDate,
CalendarDate <= TermDate
)
)
Reference:
Output Result
With this code implemented, the gallery will only display rows with dates in the current month. For illustration, if today’s date is 6/16/2021, the output will be:
Title | CalendarDate |
---|---|
Tuesday, June 1, 2021 | 6/1/2021 |
Wednesday, June 30, 2021 | 6/30/2021 |
Should you encounter any challenges while implementing this or need further assistance on other technical fronts, do not hesitate to contact us. Our team is here to help, ensuring you can achieve the desired outcome. Leveraging our expertise can save you time and prevent potential pitfalls.
‘Filter Power Apps Gallery Dates’, our guide highlights a step-by-step process to ensure only current month dates are displayed. This technique, when implemented correctly, enhances user experience and ensures relevant time-sensitive data is at the forefront.
Conclusion
Filtering a Power Apps gallery by dates in the current month is a useful feature, especially when you need to showcase time-sensitive data. We hope this guide simplifies the process for you. Remember, for any complexities or deeper customizations, our team is just a click away. Harness our expertise to elevate your Power Apps experience.