Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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.

Categories:
  • Suggested answer
    MichaelFP Profile Picture
    1,827 Super User 2025 Season 1 on at
    Filtering Gallery By Dates
    I'm Brazilian too, try on excel to put the date columns as utc time. I think this will solve your issue
  • Suggested answer
    Michael E. Gernaey Profile Picture
    40,272 Super User 2025 Season 1 on at
    Filtering Gallery By Dates
    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
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard