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
PowerApps Staff EvanChakiMSFT
PowerApps Staff

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.

2 REPLIES 2
PowerApps Staff CWesener
PowerApps Staff

Re: Unable to filter data table based on date fields

Adding @EvanChakiMSFT who can help here.

Thanks,
Clay.
PowerApps Staff EvanChakiMSFT
PowerApps Staff

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.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 318 members 4,362 guests
Please welcome our newest community members: