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

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

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 174 members 5,398 guests
Please welcome our newest community members: