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 / Combobox sorting isn't...
Power Apps
Unanswered

Combobox sorting isn't working with Distinct

(0) ShareShare
ReportReport
Posted on by 134

Hello, 

 

I have a column data loaded into combobox from a collection. trying to apply sorting but doesn't work. Am i doing something wrong here. Below is my code.

 

 

 

Sort(
 Distinct(
 collResponseData,
 DateValue(StartDate)
 ),
 Result,
 Ascending
)

 

 

 

 

vermaaman_0-1674486723014.png

 

Your help is highly appreciated.

Categories:
I have the same question (0)
  • Akser Profile Picture
    1,546 Moderator on at

    The result of distinct is string, so technically your formula works 🙂 

     

    Simply convert it back to date and time (DateTimeValue).

  • vermaaman Profile Picture
    134 on at

    @Akser Just tried that, it is now converting to year to 2024 though i have data only for 2021, 2022 and 2023 also the sorting isn't in chronological order.

     

    vermaaman_0-1674488094554.png

     

  • Akser Profile Picture
    1,546 Moderator on at

    I assume you'd like to have distinct days? 

    Sort(
     Distinct(
     collResponseData,
     Text(StartDate, ShortDate)
     ),
     DateValue(Result),
     Ascending
    )

     

  • vermaaman Profile Picture
    134 on at

    Hi @Akser - Yes, i have distinct days, these dates are coming from collection. I tried your last code, still not sorting. 

    vermaaman_0-1674490546827.png

     




  • Akser Profile Picture
    1,546 Moderator on at

    Interesting. Let's see if sorting first will do the trick:

     

    Distinct(
     SortByColumns(
     collResponseData, 
     StartDate, 
     Ascending), 
     Text(StartDate, ShortDate)
    )

     

  • vermaaman Profile Picture
    134 on at

    Hi @Akser - Thanks for not giving up so far. Still not working. 

     

    Do you think there might be some conversion issue ?

     

    vermaaman_0-1674617603394.png

     

     

  • Akser Profile Picture
    1,546 Moderator on at

    Hi @vermaaman,

     

    You are sure that 'StartDate' is of type date? 

  • vermaaman Profile Picture
    134 on at

    @Akser Getting JSON >> Manipulating it, converting type of StartDate and saving in collection. looks like it is still a text!!

     

    vermaaman_1-1674700038643.png

     

     

  • Akser Profile Picture
    1,546 Moderator on at

    @vermaaman, that's a lot of columns... I also do not see where you convert StartDate to DateValue?

     

    Anyway, now that we know it's a text column, let's try this:

     

    Distinct(
     Sort(
     collResponseData,
     DateValue(StartDate)
    ),
    StartDate)

     

     

  • Blarue Profile Picture
    76 on at

    I have the same problem with a much simpler data source. I have a basic collection with one column (Value) using this formula on my Items property and it does nothing. 

     

    Sort(Distinct(Col_GalProducts, Value), Value,SortOrder.Ascending)

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard