cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Post Partisan
Post Partisan

Canvas App- Date Filter

Trying to display the reports based on the date filter.

 

Current Setup :

  1. DataTable
  2. DatePicker1
  3. DatePicker2

AVTS_0-1620387485653.png

Datasource is selected in Datatable Items : Dailyinventory.

 

How to display the filter based table results in the Datatable

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
zaphod88
Responsive Resident
Responsive Resident

Made an error in pasting as we are using semicolon instead of comma here in Germany. Corrected:

Filter (Dailyinventory, DateColumn >= StartDate.SelectedDate && DateColumn <= DateAdd(DateAdd(EndDate.SelectedDate,1,Days),-1,Milliseconds))

View solution in original post

Great . Looks its giving the correct result. Thank you friend.

View solution in original post

22 REPLIES 22
eka24
Super User
Super User

Hi @AVTS 

On the items property of the DataTable:

 

Filter (Dailyinventory, DateColumn >= StartDate.SelectedDate && DateColumn <= EndDate.SelectedDate)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

AVTS
Post Partisan
Post Partisan

I am getting error ,

 

AVTS_0-1620390405938.pngAVTS_1-1620390437708.png

 

Change the name of the Datapickers to your Datapicker names:

Filter (Dailyinventory, DateColumn >= DatePicker1.SelectedDate && DateColumn <= DatePicker2.SelectedDate)

 

Also change the DateColumn to your actual Date column name

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

AVTS
Post Partisan
Post Partisan

Datecolumn is short date,following error . Is this incorrect format ?

 

AVTS_0-1620394046107.png

 

Remove the Today () from the formula since it could be picked from Datepicker

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

AVTS
Post Partisan
Post Partisan

Hi,

 

Almost ok. But date selection todate i have to given one more date get previous date data.

Example i have 02.05.2021 is having 10 records. So when i give fom 02.05.2021 to 02.05.2021 no data displaying whereas if i give to date 02.05.2021 to 03.05.2021 then records are displaying

Filter(Dailyinventory, 'Created On' >= DatePicker2.SelectedDate && 'Created On' <= DatePicker3.SelectedDate )

zaphod88
Responsive Resident
Responsive Resident

Then try this:
If(DatePicker2.SelectedDate = DatePicker3.SelectedDate,

  Filter(Dailyinventory, 'Created On' = DatePicker2.SelectedDate,
  
Filter(Dailyinventory, 'Created On' >= DatePicker2.SelectedDate && 'Created On' <= DatePicker3.SelectedDate )) 

Is this correct ? i can see duplication of this line ?

Filter(Dailyinventory, 'Created On' = DatePicker2.SelectedDate,

zaphod88
Responsive Resident
Responsive Resident

Yep. It's a condition: If the picked dates in both pickers are the same, the list is filtered for this date (if DatePicker2 or DatePicker2 does not matter, as it's the same date). Otherwise (if the picked dates are different), the list is filtered for a date range.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,294)