Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Sort by date and time

Posted on by 43
Hi
 
I want to sort my column, depend on datepicker (start) and datepicker (end).
Also the dates have time, so it must be sort ascending by time.
 
Thx
Categories:
  • Verified answer
    jpespena Profile Picture
    jpespena 264 on at
    Sort by date and time
    Hi,
     
    If you want to sort by your Date and Time column, try:
    SortByColumns(
         'YourDataSource',
         "DateTimeColumnName",
         SortOrder.Ascending
    )
     
    If you want to consider your start and date range picker and sort only items that falls inside the date range, add a filter like this:
     
    SortByColumns(
       Filter(
         'YourDataSource',
         Or(IsBlank(startdatepicker.SelectedDate),
         DateTimeColumnName >= startdatepicker.SelectedDate),
         Or(IsBlank(enddatepicker.SelectedDate),
         DateTimeColumnName <= enddatepicker.SelectedDate),
         )
         "DateTimeColumnName",
         SortOrder.Ascending
    )
     

    If my post helped resolve your issue, please click Accept as Solution—this helps others find it more easily and marks the item as closed. If you found this or my previous reply helpful, a Like would also be appreciated!

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard