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
)