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 / Dates from excel not s...
Power Apps
Unanswered

Dates from excel not sorting properly

(0) ShareShare
ReportReport
Posted on by 10

Hi for some reason the dates are not showing properly.  I've updated the data format using 

 

DateValue(DateCompleted,"en-GB")

 

But it is still not showing properly. Any ideas?

 

Attached a screenshot... 

 

many thanks

 

 

Untitled.jpg
Categories:
  • Rick72 Profile Picture
    385 on at

    Hi @Moranox,

     

    Could you also show what is configured in the property "Items" of the gallery and if it is using a collection show how the collection is created. That way we can understand your situation better.

     

    Robot Happy Rick

  • Moranox Profile Picture
    10 on at

    Hi Rick,

     

    Please see below.

     

    SortByColumns(Search(DailyCheck, TextSearchBox1.Text, "DateCompleted"), "DateCompleted", If(SortDescending1, Descending, Ascending))

     

     

    Many thanks for your help.

     

    Hans

  • Rick72 Profile Picture
    385 on at

    Just for the check-double-check:

    1. "DailyCheck" is a SharePoint list?
    2. The date shown in the gallery is the column "DateCompleted"?
  • Moranox Profile Picture
    10 on at

    Hi

     

    "DailyCheck" is a Sheet in an Excel document saved on Business Onedrive.

    "DateCompleted" is the item I've been trying to sort by date in the gallery. 

     

    Thank you

     

    Hans

  • Rick72 Profile Picture
    385 on at

    O bummer. I overlooked the title.

     

    So still for the check double-check: The date shown in the gallery is the column "DateCompleted"?

  • Moranox Profile Picture
    10 on at
    Hi,

    Yes this is correct.

    Thanks

    Ha s
  • Rick72 Profile Picture
    385 on at

    Hi Hans,

     

    I just tried to reproduce your situation (easy version).

     

    I have an Excel file in OneDrive. It has a table with 2 columns: Product and Date. When I create an app based on this table, and I update the formula for the property "Items" for the gallery control so it sort on date, it sorts on the date just fine.

     

    I suspect DateCompleted in Excel is not of type "Date". Is this true?

     

    Robot Happy Rick

  • Moranox Profile Picture
    10 on at
    Hi

    This is correct. I cannot change it in table mode.

    Thank

    H
  • Rick72 Profile Picture
    385 on at

    Ok. Than is that your problem I am afraid. "Fix" Excel and sorting will be possible.

     

    I do not know how many items are in the Excel table, but perhaps - I let that testing up to you - it is also possible to create a collection using the SortByColumns function and the AddColumns function and the DateValue function on the Excel table. This collection is then used the property "Items".

     

    ClearCollect(newTable, SortByColumns(AddColumns(DailyCheck, "newDateCompleted", DateValue(DateCompleted)), "newDateCompleted")

     

    Please share your results with us.

     

    Robot Happy Rick

  • Moranox Profile Picture
    10 on at

    Hi Rick,

     

    Hope you are well. Apologies for my late reply.  Unfortunately, solution you proposed did not work as expected.  However, you mentioned changing the format to date in your earlier message and that was the problem.  I've managed to do it and it resolved the problem. 

     

    The solution

    Change the Format to Date in the Excel Document using Table Query window, not by using the format dropdown from the Home Ribbon.

     

    Many thanks for your help.

     

    Kind regards

     

    Hans

     

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard