cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Dates not sorting correctly

I'm trying to sort a gallery by date (european style) and for some reason the dates aren't sorting correctly by the months, it only sorts by days and completely ignores the months, the code I have is:

    SortByColumns(
        Filter(Table1_2, 
            DateValue(Text(DATA, "[$-en-US]mm/dd/yyyy"), "en") >= DateValue(Text(HOJE.SelectedDate, "[$-en-US]mm/dd/yyyy"), "en") &&
            If(!IsBlank(dpSearchDate.SelectedDate), DateValue(Text(DATA, "[$-en-US]mm/dd/yyyy"), "en") >= DateValue(Text(dpSearchDate.SelectedDate, "[$-en-US]mm/dd/yyyy"), "en"), true)
        ),
        "DATA",
        If(SortDescending1,Descending,Ascending)
    )

I have tried everything but it doesn't seem to work, what can I do?
Note: The attached image is a Gallery.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Dates not sorting correctly

Solved it by changing the SortByColumns to a Sort function and the "DATA" to DateValue(DATA).

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Re: Dates not sorting correctly

Solved it by changing the SortByColumns to a Sort function and the "DATA" to DateValue(DATA).

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,922)