cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TMelton
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
Lancepr
Frequent Visitor

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
v-yamao-msft
Community Support
Community Support

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.

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
Frequent Visitor

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

you will have problems with delegation in this way.

 

Need a workaround.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,708)