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 / Filter expression for ...
Power Apps
Unanswered

Filter expression for a combo box

(0) ShareShare
ReportReport
Posted on by 115

Hello Everyone.

 

Recently there was a change in database because of which one choice column was made multi select. 

Before my filter was on a dropdown and its was working fine. But now I want to change it to a combo box.

 

 

My Current filter condition looks like:

 

If(
IsBlank(ComboBox2_1.Selected) && IsBlank(Dropdown1_13.Selected.Value) && IsBlank(DatePicker1.SelectedDate) && IsBlank(DatePicker1_1.SelectedDate),
Filter(PO, User().Email = 'Created By'.Email),
If(
DatePicker1.SelectedDate <= DatePicker1_1.SelectedDate,
Filter(
PO,
(IsBlank(ComboBox2_1.SelectedItems) || ComboBox2_1.Selected.Value in IS.Value) &&
(IsBlank(Dropdown1_13.Selected.Value) || Status.Value = Dropdown1_13.Selected.Value) &&
(IsBlank(DatePicker1.SelectedDate) || StartDate >= DatePicker1.SelectedDate) &&
(IsBlank(DatePicker1_1.SelectedDate) || EndDate <= DatePicker1_1.SelectedDate) &&
User().Email = 'Created By'.Email
),
Filter(PO, false) // Show no results when date range is invalid
)
)

 

What I want: If my dropdown, combo box and both date pickers are empty I want to show everything in the gallery and created by = current user.

If the start date > end date I should show an empty, if possible a message saying please enter correct filters or your start date is greater than end date. 

 

Then if something is selected in dropdown, or multiple values are selected in combo box it should filter that in the gallery. Plus date pickers too.

 

 

What currently is happening: Everything is working fine except:

 

1) I want to show message :  saying please enter correct filters or your start date is greater than end date. 

This is not compulsory, currently it is showing empty gallery which is fine too.

 

2) If I select multiple entries in combo box it should filter that. Currently whatever I select latest its showing that in gallery. I know I have used combobox.Selected there instead of combobox.SelectedItems. This is because I was getting an error and was not able to find any substitute for it. So, please suggest me something for this.

 

 

 

Please suggest me a expression where combobox works. Gallery showing filters incorrect can be ignored for the moment.

If there any other flaws you see in the filter do tell me that too or if there is any other scope of improvement.

 

Thanks. 😄

 

 

@WarrenBelz @LaurensM @FLMike @BCBuizer @Amik @SpongYe 

Categories:
  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @Unknown123 

     

    Can you try this? This is untested but hope you get the gist. 

    With({
    	_Date1: DatePicker1.SelectedDate,
    	_Date2: DatePicker1_1.SelectedDate,
     _DDValue: Dropdown1_13.Selected.Value
     _CBItems: ComboBox2_1.SelectedItems
     },
    
    If(
     _Date1 > _Date2,
     Notify("Please enter correct filters or your start date is greater than end date."),
     Filter(
     PO,
     And(
    		IsBlank(_CBItems) || IS.Value in ComboBox2_1.SelectedItems.Value, // may change this to ComboBox2_1.SelectedItems
     	IsBlank(_DDValue) || Status.Value = _DDValue,
     	IsBlank(_Date1) || StartDate >= _Date1,
     	IsBlank(_Date2) || EndDate <= _Date2,
     		'Created By'.Email = User().Email
    			)
     		)
    	)
    )

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard