Hi Community!
I’m encountering an issue when trying to filter records between two dates in Power Apps. The filter doesn’t return the expected results when the date range spans across the end of one year (e.g., December 2024) and the beginning of the next year (e.g., January 2025).
Here’s the filter formula I’m using:
ClearCollect(
ColFiltrados,
Filter(
CONTROLE_EMBARQUE_ATT_2,
// ETD (Date range filter)
IsBlank(Dt_ETD_DE_12.SelectedDate) Or
IsBlank(Dt_ETD_ATE_12.SelectedDate) Or
(DateValue(ETDPrev) >= Dt_ETD_DE_12.SelectedDate And DateValue(ETDPrev) <= Dt_ETD_ATE_12.SelectedDate)
)
)
Additional Information:
- The
ETDPrev column in the database is formatted as Date.
- The controls
Dt_ETD_DE_12 and Dt_ETD_ATE_12 are DatePicker controls in Power Apps.
- The filter works correctly for dates within the same year but fails when the range spans two different years (e.g., 12/15/2024 to 01/10/2025).
- I’ve tried using
DateValue to ensure the values are treated as dates, but the issue persists.
What I Need:
I need the filter to work properly for ranges that span across two years. Has anyone faced a similar issue or knows how to fix this?
Thanks in advance for your help! 😊