cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Filtering a Gallery by 2 date pickers.

Hello everyone. I am still a little newer to powerapps, but I have a question that has been bothering me for about a week. 

 

I have a gallery (from sql) that has dates in it, I have two date pickers that I need to filter the gallery, like a "start" and "end" date. Capture.PNG

 

Please excuse the lack of formating, but it would be great to get these filters working

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Filtering a Gallery by 2 date pickers.

This is how I got it to work

DP_Start is my first date picker

DP_End is my second date picker

 

Filter('[dbo].[tbl_tablename]',DateValue(Text(Date)) >= DateValue(Text(DP_Start.SelectedDate)) && DateValue(Text(Date)) <= DateValue(Text(DP_End.SelectedDate)))

 

I had to convert my dates using datevalue, even tho the SQL data type was date

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Filtering a Gallery by 2 date pickers.

Hi @TMelton,

 

Do you want to filter out records that are within a specific date range?

Please check if the following function will work for you:

Filter([dbo].[Table2],Start>DatePicker3.SelectedDate,End<DatePicker4.SelectedDate)

Please feel free post back if you need more help.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Filtering a Gallery by 2 date pickers.

Thanks for getting back to me @v-yamao-msft

 

For this, I put the Column I want to be greater then datepicker where you have "start", or is "start" a function in it self?

 

Edit - So it looks like this is trying to work, but because I have a timezone offset, it is breaking. I am also getting another error, that says "Error on the server" 

 

The time Zone Error says "Expected a valid date value as the parameter to 'TimeZoneOffset' function, recieved value: null"  This function works without the Filter statement

TimeZone Error.PNG

Highlighted
Frequent Visitor

Re: Filtering a Gallery by 2 date pickers.

This is how I got it to work

DP_Start is my first date picker

DP_End is my second date picker

 

Filter('[dbo].[tbl_tablename]',DateValue(Text(Date)) >= DateValue(Text(DP_Start.SelectedDate)) && DateValue(Text(Date)) <= DateValue(Text(DP_End.SelectedDate)))

 

I had to convert my dates using datevalue, even tho the SQL data type was date

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Filtering a Gallery by 2 date pickers.

you will have problems with delegation in this way.

 

Need a workaround.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,434)