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

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

Adding @EvanChakiMSFT who can help here.

Thanks,
Clay.
Power Apps
Power Apps

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (33,600)