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
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
Power Apps
Power Apps

Re: Unable to filter data table based on date fields

Adding @EvanChakiMSFT who can help here.

Thanks,
Clay.
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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

June 2020 Community Challenge: Can You Solve These?

June 2020 Community Challenge: Can You Solve These?

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

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Users online (5,983)