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 / Adding filter to galle...
Power Apps
Answered

Adding filter to gallery that includes two dates and an blank date

(0) ShareShare
ReportReport
Posted on by 5

I am trying to sort a gallery to display records based on a drop-down selection, an Empty Exit Date, Admit date is greater than a specific date picker, and if the record has an exit date, it must be between the two date pickers.

 

SortByColumns(
    Filter(
        'DataSource',
        Or(
            IsBlank(SourceDD),
            'Referral Source'.Value = SourceDD.Selected.Value
        ),
        IsBlank('Exit Date') And 'Admit Date' <= DateTo.SelectedDate,
        'Exit Date' >= DateFrom.SelectedDate And 'Exit Date' <= DateTo.SelectedDate
    ),
    "Program",
    SortOrder.Ascending
)
Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @greylagunas87,

     

    Is there a specific error you are receiving? According to your description I have made some changes below. 😊

     

    SortByColumns(
     Filter(
     'DataSource',
     //When Source is selected, filter referral source based on the dropdown
     IsBlank(SourceDD.Selected) || 'Referral Source'.Value = SourceDD.Selected.Value,
     //Either Exit Date is empty and filter based on Admit Date only
     //Or Filter by dates between and eq to Admit Date and Exit Date
     (IsBlank('Exit Date') && 'Admit Date' <= DateTo.SelectedDate) || ('Admit Date' >= DateFrom.SelectedDate && 'Exit Date' <= DateTo.SelectedDate)
     ),
     "Program",
     SortOrder.Ascending
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • greylagunas87 Profile Picture
    5 on at

    Thank you, that worked. I wasn't receiving an error it just wasn't filtering my gallery.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard