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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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.

Captura de tela 2024-09-10 101752.png
Captura de tela 2024-09-10 103152.png
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,968 Moderator 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
    2,001 Moderator 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard