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 / Sort dates with dd/mm/...
Power Apps
Answered

Sort dates with dd/mm/yyyy format

(0) ShareShare
ReportReport
Posted on by 6

Hi all,

I have a gallery with a combo box that filters the results by type of workshop, and a dropdown for filtering by date, however I want the dates in the dropdown to be based on the type of workshop selected in the combo box. Eg if I select X Workshop in the combo box cmb_Main_Workshop, then I want the dropdown to show only the dates that this particular X workshop was held.  I have achieved this using the following:

 

Distinct(Filter('Workshop Participants', Workshop.Value in cmb_Main_Workshop.SelectedItems.Value||IsBlank(cmb_Main_Workshop.SelectedItems)).Date, Text(Date,"dd/mm/yyyy"))

 

I now want to sort the date results in the dropdown chronologically, however because I have chosen to display dates in the dd/mm/yyyy format, I cannot figure out how to make the sort work.  I suspect I need to sort the dates AFTER the filter is applied but BEFORE the text date format is applied - but not sure how to do this.

Any suggestions?

Categories:
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @phial004,

    Could you please tell me that how you set the Items of the date Combo Box?

    Do you want to formate the date in the ComboBox with "dd/mm/yyyy"?

     

    Well, I think you need to use the AddColumns to save the formatted date as a text string as below:

    AddColumns(Distinct(Filter('Workshop Participants', Workshop.Value in cmb_Main_Workshop.SelectedItems.Value||IsBlank(cmb_Main_Workshop.SelectedItems)).Date, Date),"textDate",Text(Date,"dd/mm/yyyy"))

     

  • phial004 Profile Picture
    6 on at

    Hi Qi,

     

    The Items for the date dropdown is:

    Distinct(Filter('Workshop Participants', Workshop.Value in cmb_Main_Workshop.SelectedItems.Value||IsBlank(cmb_Main_Workshop.SelectedItems)).Date, Text(Date,"dd/mm/yyyy"))

     

    The Items for the workshop combo is: Choices('Workshop Participants'.Workshop)

     

    The DataCardValue has Format: DateTimeFormat.ShortDate and DateTimeZone: DateTimeZone.Local

     

    I believe the date is already saving as a text string, which is why the sort function is not working...

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @phial004,

    Okay, so you want to sort the format date string within the ComboBox, right?

     

    If so, I think you should sort before the Text string:

    Distinct(Sort(Filter('Workshop Participants', Workshop.Value in cmb_Main_Workshop.SelectedItems.Value||IsBlank(cmb_Main_Workshop.SelectedItems)).Date, Date),Text(Date,"dd/mm/yyyy"))

     

  • phial004 Profile Picture
    6 on at

    Thanks so much Qi!  That works perfectly 😀 I had tried to do that but didn't have the right syntax.  Thanks again.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard