cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Super User
Super User

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.

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.

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.

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
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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.

<
Users online (3,536)