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 / Filter Data Table By D...
Power Apps
Answered

Filter Data Table By DatePicker Selection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

I currently have a data table which is filtered by any combination of 3 dropdowns and it works perfectly. I would like to be able to filter it also by date. Currently my data table items are set to this:

freddiejoseph1_0-1614961039846.png

 

When a user is entering data into a form the responses get sent to a sharepoint list and the start date of the task is recorded. I also patch the time into the same column as the date. So the column in the sharepoint list is a single line of text column rather than a date column. How can I manipulate my column/string in the column with the date and time in it so that I can filter by just the date selected in a datepicker?

 

freddiejoseph1_1-1614961298556.png

 

I have modified the text in my date column so it shows correctly. Left(ThisItem.StartTime, Len(ThisItem.StartTime) -6)

 

Any help would be much appreciated.

 

Thanks,

 

Freddie

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @Anonymous ,

    A bit messy, but something like this should do it.

    Filter(
     FinanceTimeLog,
     (
     IsBlank(NamePicker_1.Selected.UserPrincipalName) || 
     AgentID = NamePicker_1.Selected. UserPrincipalName
     ) &&
     (
     IsBlank(TeamPicker_1.Selected.Result) || 
     Title = TeamPicker_l.Selected.Result
     ) &&
     (
     IsBlank(DatePicker2.SelectedDate) || 
     Text(DatePicker2.SelectedDate,ShortDate) = 
     Text(
     DateValue(
     Left(
     StartTime, 
     Len(StartTime)-6
     )
     ),
     ShortDate
     )
     ) &&
     (
     CategoryPicker_l.Selected.Result = "All" || 
     ok6e = CategoryPicker_l.Selected.Result
     )
    )

    Also can you please post any code in Text (as well as an image if you want to)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Warren. That is perfect, thanks!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

     

    You helped me out with this solution a couple of days ago. Originally I was patching the time and date into a single line of text column, so when I wanted to filter my data table I had to filter by a text string as you helped me with above.

     

    I have changed the columns to date and time columns now, and the bit of formula for filtering by the date no longer works. I get the errors: "Invalid argument type (DateTime). Expecting a text value instead" and "The function 'Left' has some invalid arguments" and "The function 'Len' has some invalid arguments".

    Filter(
    FinanceTimeLog,
    (
    IsBlank(NamePicker_1.Selected.UserPrincipalName) ||
    AgentID = NamePicker_1.Selected.UserPrincipalName
    ) &&
    (
    IsBlank(TeamPicker_1.Selected.Result) ||
    Team = TeamPicker_1.Selected.Result
    ) &&
    (
    IsBlank(DatePicker2.SelectedDate) ||
    Text(DatePicker2.SelectedDate, ShortDate) = Text(DateValue(Left(StartTime, Len(StartTime) -6)), ShortDate)
    ) &&
    (
    CategoryPicker_1.Selected.Result = "All" ||
    Category = CategoryPicker_1.Selected.Result
    )
    )

     

    How can I filter the time and date column by just the date value of the date picker?

     

    Thanks,

     

    Freddie

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

    Hi @Anonymous ,

    What type of field is StartTime and what is in it?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard