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

Filter Table based off start/end date pickers and a list

I need to populate a table with multiple columns based off the chosen start/end date and a list. 

 

This is what I've tried, does not work. 

 

Filter(DataTable3,

         Text(Date_2,"mm/dd/yyyy") >= Text(DatePickerFrom.SelectedDate,"mm/dd/yyyy"),               

         Text(Date_2,"mm/dd/yyyy") <= Text(DatePickerTo.SelectedDate,"mm/dd/yyyy"),

         Ascending)

 

4 REPLIES 4
TiagoFreire
Level 8

Re: Filter Table based off start/end date pickers and a list

PowerApps is not very friendly with dates. Greater than/less than operators do not work on them. Does your data come from a SQL database? 

If so, a good bet is to convert your dates into unixtime, as it is something PowerApps understands.

I had to create a view on my database where I did a bit of massaging on dates so they came out as unixtime, So I could Sort and Filter correctly in PowerApps. 

If that's what you need, I can share the SQL trickery I did. 

TiagoFreire
Level 8

Re: Filter Table based off start/end date pickers and a list

This would be the SQL fragment you should use inside a View to display a SQL date or datetime column as a unixtimestamp.

This returns an integer, which is the unixtimestamp equivalent of the date or datetime. So In PowerApps, you can use greater than/less than operators, which do not work in dates currently. 

DATEDIFF_BIG(s, '1970/01/01 00:00:00', dbo.table.some_date) * 1000 AS unixtimestamp_some_date 

 

TheRobRush
Level 8

Re: Filter Table based off start/end date pickers and a list

 

Populated a collection with various dates, below is  a picture of the two date pickers for the range, a gallery that just shows all, and the filtered gallery. Formula I used is in red. You should be able to use this to figure out yours. Good Luck! If it works mark this as a solution thanks!

CaptureDate.PNG

TopShelf-MSFT
Level 10

Re: Filter Table based off start/end date pickers and a list

Hi @dmart how are you progressing with this? Were the above replies helpful?

 

@TopShelf-MSFT 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

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,071)