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 / Calendar Filter not wo...
Power Apps
Answered

Calendar Filter not working with a Date (AND TIME) column - Sharepoint List Data Source

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

StartDate is a Date and Time column. When it is just a date column, the calendar populates, when it is a Date and Time column, the calendar is not populated.

 

No red-X-error, the filter just doesn't work. How do I incorporate the Time into the filter to get it to show the events on the right days.


I have a calendar, filtered via Items = 

Filter(
'Training Events',
DateAdd(
_firstDayInView,
ThisItem.Value,
Days
) >= StartDate && DateAdd(
_firstDayInView,
ThisItem.Value,
Days
) <= StartDate

 

I tried to make a calculated column that split the info into just the date, but power apps doesnt like the special column.

 

thank you in advance!

 

Coverphotoprobem.PNG

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You are referencing ThisItem in your formula.  This implies that you are referencing a record of a table.  In other words, is this Gallery Items property formula you provided part of another Gallery (nested gallery)?  And if so, what is the Items property of the outer gallery?

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Anonymous ,

     

    Looking at your screenshot, the calendar is populating with the formula you have. Can you please share an example of something that isn't showing, but you would expect to see it? 

     

    I have a suspicion it may have to with some missing brackets in your conditions due to which && and || operators are not behaving as desired.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi thank you for the response. I tried to be more thorough. 

     

    The calendar populate great when i use the date only column. I want to use a date with time column and the fact that it has time seems to be throwing something off. 😞

    walkthrough1.png@RandyHayes @BCBuizer 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Dates in SharePoint always have the Time as well.  If you have specified Date only, then the Time will always be 00:00:00 or 12 midnight.  

    So keep this in mind when comparing.  

    If you were to compare Now() with today's date in a list, it would never compare.  This is because Now would include the Time and that would not compare to 00:00:00

     

    So how are you trying to actually incorporate the Time into your scenario?

    You might have answered this in your picture (not in words so much as in detail) but it is very hard to see the picture as it shows up quite small.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes  Im not worried about incorporating it, per say. 

     

    The scenario is that the calendar (gallery) populates when I reference a SharePoint column with only the date (column name StartDate)

    . When i try to reference a SharePoint column including time (StartDateTime), it doesn't populate a single thing. I cant understand why...

    so my issue is it is not letting me reference the column including the time, only a column with a date.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, so Time is going to play a part of your formula in the comparison.  You need to account for it in the formula.

     

    Please consider changing your Formula to the following:

    Filter('Training Events',
     DateAdd(_firstDayInView, ThisItem.Value, Days) >= StartDate && 
     DateAdd(
     DateAdd(_firstDayInView, ThisItem.Value + 1, Days),
     -1, Seconds
     ) <= StartDate
    )

    This will set your ending date/time to be one second before midnight on the calculated day.

     

    In other words, if your date calculation gave you a date of July 19 then that calculation (which is used in both of your comparisons would not match an actual startDate.

     

    Example.  If you have a StartDate event of 7/19/2022 13:00:00

    Then your Formula would be comparing the following (the DateAdd part of the formula has been replaced below with the actual value that DateAdd would return.

    Filter('Training Events',
     '7/19/2022 00:00:00' >= StartDate && 
     '7/19/2022 00:00:00' <= StartDate
    )

    If we substitute in the actual StartDate example Value:

    Filter('Training Events',
     '7/19/2022 00:00:00' >= '7/19/2022 13:00:00' && 
     '7/19/2022 00:00:00' <= '7/19/2022 13:00:00'
    )

     Then you can clearly see that it will *never* match!

     

    So, using the formula at the top of this reply and substituting in the DateAdd calculations, the formula becomes:

    Filter('Training Events',
     '7/19/2022 00:00:00' >= StartDate && 
     '7/19/2022 23:59:59' <= StartDate
    )

    And now putting in the StartDate example:

    Filter('Training Events',
     '7/19/2022 00:00:00' >= '7/19/2022 13:00:00' && 
     '7/19/2022 23:59:59' <= '7/19/2022 13:00:00'
    )

    You can see that this WILL match.

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard