web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering data using d...
Power Apps
Answered

Filtering data using date picker cause problem

(0) ShareShare
ReportReport
Posted on by 10

I'm using the below code on a gallery to filter data using various dropdown filters. There are 3 dates range filters:

  • Changedate_1: when I select 13/5/2024, I receive 2 records instead 5 records for that date as an example.

Lakmini_0-1717164388771.png

 

Lakmini_1-1717164388775.png

 

Date

Num of Records

Num of Records when I select the Date

5/9/2024

1

1

5/11/2024

1

0

5/12/2025

1

0

5/13/2026

5

2

5/14/2027

5

3

5/26/2028

2

2

5/27/2028

4

4

5/28/2028

2

2

5/30/2028

2

2

 

  •  StartDateTimer_3: when I select Start Date 13/5/2024, I receive all correct records (5 records for 13/5/2024, and 5 records for 14/5/2024,…..)

Lakmini_2-1717164388779.png

 

  • EndDateTimer_3: when I select End Date 14/5/2024, I receive only 8 records instead 10 records (5 records for 13/5/2024 and 3 records for 14/5/2024,….); But, if I select End Date 15/5/2024, I receive 10 records (5 records for 13/5/2024 and 5 records for 14/5/2024,….)   

Lakmini_3-1717164388782.png

 

Lakmini_4-1717164388787.png

 

 

Filter(

    'FAK-ACM-Records',

    (Station = drpStation_2.Selected.Value || drpStation_2.Selected.Value = Blank()) && (EmpID = drpEmpId_1.Selected.Value || drpEmpId_1.Selected.Value = Blank()) && (IssuedTo = Issued.Selected.Value || Issued.Selected.Value = Blank()) && (Date = Changedate_1.SelectedDate || Changedate_1.SelectedDate = Blank()) && (Date >= StartDateTimer_3.SelectedDate || StartDateTimer_3.SelectedDate = Blank()) && (Date <= EndDateTimer_3.SelectedDate || EndDateTimer_3.SelectedDate = Blank())

)

 

Also, when I checked the data below, I found when I create the record for 5/28/2024 @ 12:08:30AM, it saved my date as 5/27/2024; but no problem for records created on 5/30/2024 @ 12:27:10AM and @ 12:28:35AM.

Lakmini_5-1717164388789.png

 

 

How do I alter this to make it work correct?

 

Thanks for your support.

 

 

Categories:
  • Lakmini Profile Picture
    10 on at

    I need help please, It's 2 days now and I can't find my mistake.

    Thanks a lot for your support.

     

  • WarrenBelz Profile Picture
    156,570 Most Valuable Professional on at

    @Lakmini ,

    Your problem seems to be the data, not the filter (which seems fine to me).

    Filter(
     'FAK-ACM-Records',
     (
     Station = drpStation_2.Selected.Value || 
     drpStation_2.Selected.Value = Blank()
     ) && 
     (
     EmpID = drpEmpId_1.Selected.Value || 
     drpEmpId_1.Selected.Value = Blank()
     ) && 
     (
     IssuedTo = Issued.Selected.Value || 
     Issued.Selected.Value = Blank()
     ) && 
     (
     Date = Changedate_1.SelectedDate || 
     Changedate_1.SelectedDate = Blank()
     ) && 
     (
     Date >= StartDateTimer_3.SelectedDate || 
     StartDateTimer_3.SelectedDate = Blank()
     ) && 
     (
     Date <= EndDateTimer_3.SelectedDate || 
     EndDateTimer_3.SelectedDate = Blank()
     )
    )

    The problem is that your post possibly confuses this so you need to clarify if the filter is actually returning what is in SharePoint correctly, then it can be disregarded. I would normally suggest that the day before is a classic Time Zone conflict between the local user and the SharePoint site, but you have pointed out that other entries within an hour difference work fine.
    You also need to post how you populate field_1 (I assume this is the Date field)

     

  • Lakmini Profile Picture
    10 on at

    Thanks Mr. Warren for your reply. Please see attached file

  • Verified answer
    WarrenBelz Profile Picture
    156,570 Most Valuable Professional on at

    @Lakmini ,

    That does not help me with the questions I asked - is your SharePoint Data correct and the issue is with the filter, or is the filter correct and the issue is with the data that is written ? Also how do you write the data to the Date field ?

  • Lakmini Profile Picture
    10 on at

    Thanks Warren,

    the issue was with the SharePoint Data. The problem has been solved.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard