cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TMelton
Level: Powered On

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
Lancepr
Level: Powered On

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
Community Support Team
Community Support Team

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.
TMelton
Level: Powered On

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

Lancepr
Level: Powered On

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

AndiRodi
Level: Powered On

Re: Filtering a Gallery by 2 date pickers.

you will have problems with delegation in this way.

 

Need a workaround.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,144)