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 / Sorting gallery on ful...
Power Apps
Answered

Sorting gallery on full date

(0) ShareShare
ReportReport
Posted on by 61

Hi guys!

I have an issue i haven't could find a solution to, which are when sorting gallery, is it possible to sort by full date (dd:mm:yy) instead of sorting on only (dd)?

Now it only sort on descending or ascending based upon days and not the full date, 

example on this issue in order of how the gallery is being sorted:

30-01-2018

29-01-2018

8-02-2018

7-02-2018

 

Here it is sorting on highest date only on days not countering months and years with it.

It should be 

8-02-2018

7-02-2018

30-01-2018

29-01-2018

 

I hope i have explained my issue sufficient or else, please ask for more explanation! 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @BQC

     

    could you pls share a little bit more of your sorting code? 🙂

    The sort in a gallery with the full date works fine for me with the code 

    Sort(sorttest,date,Descending)

    sorting.PNG

     

    Best regards

    Vasii

  • BQC Profile Picture
    61 on at
    SortByColumns(Search(Kvalitetsdata; TextInput6.Text; "AntalAfvist";"AntalBestilt";"Leverandør";"Dato";"Medarbejder"; 
    "AntalGodkendt"); "Dato"; If(SortDescending1; Descending; Ascending))

    The above is the code i have right now set as Items.

    My datasource is google sheets.

    The gallery is combined with a search field, which filters based on search words

  • BQC Profile Picture
    61 on at

    @Anonymous Any ideahow to resolve this issue?

  • BQC Profile Picture
    61 on at

    If i change my code from sortbycolumns to sort, it does the job of sorting as wished. but it is sorting in the wrong order. 

     

    30-01

    31-01

    01-02

    02-02

    I need it to be reversed so it shows the lastest first. 

    with the change from sortbycolumns to

    Sort(Search(Kvalitetsdata; TextInput6.Text; "AntalAfvist";"AntalBestilt";"Leverandør";"Dato";"Medarbejder"; 
    "AntalGodkendt"); "Dato";If(SortDescending1; Descending; Ascending))

    the function If(SortDescending1; ) has stopped working with the binded icon. I can't use this function to change between Descending - Ascending. What gives? 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @BQC,

     

    i am sorry, unfortunately i was very ill the last time. 😞

     

    Could you pls show me a screenshot of your scenario and what do you mean with the function If(SortDescending1; ) has stopped working, what did you do with this function in your scenario?

     

    Best regards

    Vasii

  • BQC Profile Picture
    61 on at

    @Anonymous 
    image.pngAs displayed on the above image, i have a icon with sorts the gallery by descending and acending but if i change my gallery code 

    SortByColumns(Search(Kvalitetsdata; TextInput6.Text; "AntalAfvist";"AntalBestilt";"Leverandør";"Dato";"Medarbejder"; 
    "AntalGodkendt"); "Dato"; If(!SortDescending1; Descending; Ascending))

    To the one you suggested, i cannot change the order with the binded icon.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @BQC

     

    I've tried it with the Sort function and it's working fine for me.

    Take a look at this Link for more information about the SortByColumn function, i think it's not working for you, cause you have to make a SortOrder for each column you'll sort.

     

    I never used SortByColumn before, maybe you can get some help from @v-xida-msft or @v-yuxima-msft x)

     

    Best regards

    Vasii

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @BQC thanks for posting in the community and I'm sorry you're running into this issue. Can you advise if you're still experiencing this issue and if the above reply was helpful?

     

    Thank you,

     

    @Anonymous 

  • BQC Profile Picture
    61 on at

    hello @Anonymous 

    I still haven't figured out how to resolve the issue and don't know how i should write the code. I am not so strong in the coding part

  • Verified answer
    BQC Profile Picture
    61 on at

    For those with similiar issues. I have finally found the solution.

    I found out that excel online from onedrive and Powerapps aren't that good friends when it coming to formatting.

    So i had to change the default format in excel to their date format through formatting.

    The code i needed to use for the gallery:

    Sort(Kvalitetsdata;DateValue(Dato);Descending)

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard