web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering Gallery By D...
Power Apps
Unanswered

Filtering Gallery By Dates

(1) ShareShare
ReportReport
Posted on by 8
Hello everyone, 
 
I´ve been developing this Power Apps, where i have a gallery connected to my Excel file.
 
And i want to be able to filter this gallery selecting a date, the biggest issue is that if I have any rows in my Excel file between two occurrences of a date (01/01/2025), those rows appear completely blank in my Power Apps filter.

My filter formula is intended to capture all the distinct dates in my file.
 
Sort(
    Distinct(
        Contratos;
        IfError(
            'Mês de Reajuste';
            Blank();
            Text(DateAdd('Mês de Reajuste'; TimeZoneOffset(Now()); TimeUnit.Minutes); "dd/mm/yyyy")
        )
    );
    Value;
    SortOrder.Ascending
)

The filter within the gallery is set up this way. Like this:
 
IsBlank(ComboboxCanvas1_2.SelectedItems) Or IsEmpty(ComboboxCanvas1_2.SelectedItems) Or
Text(DateAdd('Mês de Reajuste'; TimeZoneOffset(Now()); TimeUnit.Minutes); "dd/mm/yyyy")
in ComboboxCanvas1_2.SelectedItems
;

And this is how i display this column inside the gallery
IfError(
    Text(DateAdd(ThisItem.'Mês de Reajuste'; TimeZoneOffset(Now()); TimeUnit.Minutes); "dd/mm/yyyy");
    Blank();
    Text(DateAdd(ThisItem.'Mês de Reajuste'; TimeZoneOffset(Now()); TimeUnit.Minutes); "dd/mm/yyyy"))
 
 

Just to be clear, since I live in Brazil, when I import dates from Excel into Power Apps, dates like (01/07/2024)
turn into (30/06/2024 21:00:00) due to the time zone difference. Therefore, I had to adjust the date
by adding the time zone offset to display it correctly.

 


Showing the problem, in Power Apps, when I filter by this date, you can see that there is a completely blank row between two occurrences of (01/01/2025). This is reflected in my gallery, and this is how the dates are arranged in my Excel file. Notice that there is a single blank row between the two rows with (01/01/2025), and this is being shown in the gallery. I want to filter the dates so that these blank rows do not appear. With the current approach, this issue occurs in several cases, and in my application, it's normal to have rows with empty dates; I just don't want them to appear this way when filtered by date.
 
01/01/2025
01/08/2024
01/03/2025
01/10/2024
01/12/2024
01/08/2024
01/04/2024
01/12/2024
01/04/2024
 
01/03/2025
01/06/2024
01/04/2024
01/04/2024
01/04/2024
01/09/2024
01/08/2024
01/08/2024
01/12/2024
01/12/2024
01/12/2024
01/04/2024
01/04/2024
01/06/2024
01/12/2024
01/01/2025
 

If anyone can help, I would be very grateful. If anything about my problem isn't clear, I would be happy to provide more details and clarify further.

Thanks in advance.

Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi
     
    Filter
     
    Sort(
        Filter(
            Distinct(
               Contratos;
                IfError(
                   'Mês de Reajuste';
                   Blank();
                   Text(DateAdd('Mês de Reajuste'; TimeZoneOffset(Now()); TimeUnit.Minutes); "dd/mm/yyyy")
             )
          );
        ,
          !IsBlank(Value)
       );
     
        Value;
        SortOrder.Ascending
    )
     
     
    There are other ways, but for now since its creating a blank just filter your distinct where its not blank
     
  • Suggested answer
    MichaelFP Profile Picture
    1,847 Super User 2025 Season 2 on at
    I'm Brazilian too, try on excel to put the date columns as utc time. I think this will solve your issue

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard