cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Unable to filter data table based on date fields

Hello,

 

I have created a data table from an entity that has a field called "Start Date".  I also have a date picker, and when the user selects a date in the date picker, I want to only show items with that particular Start Date.  My formula is as follows: Filter(EntityName, startdate = DatePicker.SelectedDate)

Nothing shows up when I filter the data based on the date picker.  However, if I make both fields text formulas, so my formula looks like this, Filter(EntityName, Text(startdate) = Text(DatePicker.SelectedDate)), the formula now works and the table gets filtered.  I want to be able to filter based on date fields, not text fields, but this does not seem to be possible with the new CDS.  Am I doing soemthing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Unable to filter data table based on date fields

A few things to look at for your Start Date field.  Check the field type to see if it is date or date time.   If it is datetime, then the equals will not work because the time will not match.  I created a date field and used this formula with my Accounts entity.

 

Filter('Accounts',new_startdate = DatePicker1.SelectedDate)

 

If you try this using the createdon field, which is datetime, you can see how it will not show up.  However, try greater than or less than and it will work: Filter('Accounts',createdon > DatePicker1.SelectedDate).

 

If you field is datetime you can use this in the gallery: Filter('Accounts',DateValue(Text(createdon)) = DatePicker1.SelectedDate) and it will match your date seleted to your full date in your CDS table.

View solution in original post

2 REPLIES 2
Highlighted
Power Apps
Power Apps

Re: Unable to filter data table based on date fields

Adding @EvanChakiMSFT who can help here.

Thanks,
Clay.
Highlighted
Power Apps
Power Apps

Re: Unable to filter data table based on date fields

A few things to look at for your Start Date field.  Check the field type to see if it is date or date time.   If it is datetime, then the equals will not work because the time will not match.  I created a date field and used this formula with my Accounts entity.

 

Filter('Accounts',new_startdate = DatePicker1.SelectedDate)

 

If you try this using the createdon field, which is datetime, you can see how it will not show up.  However, try greater than or less than and it will work: Filter('Accounts',createdon > DatePicker1.SelectedDate).

 

If you field is datetime you can use this in the gallery: Filter('Accounts',DateValue(Text(createdon)) = DatePicker1.SelectedDate) and it will match your date seleted to your full date in your CDS table.

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (6,736)