web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sort Month Name in Dro...
Power Apps
Answered

Sort Month Name in Dropdown

(0) ShareShare
ReportReport
Posted on by 67

I have a dropdown that filters from a CDS datasource on Date. I have converted from showing 11/2019 to be Nov 2019.  How can I sort the dropdown to based on Month instead of alphabetically.  See attachment. 

 

My filter formula: Sort(Distinct(Filter('Time Entries',msdyn_bookableresource.'Primary Email'=CurrentUser.Email),Text(msdyn_date,"[$-en-US]mmm") & " " & Text(msdyn_date,"[$-en-US]yyyy")),Result)

 

 

 
 
 
 
Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @yichingjc 

    Your functions are currently nested like this:

    • Sort
    • Distinct
    • Filter

     

    Have you tried nesting them in this order instead?  My thought is the date should be sorted before it is converted to text by the 2nd argument of DISTINCT 

    • Distinct
    • Sort
    • Filter

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • yichingjc Profile Picture
    67 on at

    @mdevaney  I need to sort the dropdown by Month name = Nov 2019, Dec 2019, Jan 2020, Feb 2020, Mar 2020 etc.  Using sort and sortbyColumn you can only do ascending or descending. 

  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @yichingjc 

    Have you tried my suggestion or are you just assuming it won't work?  I tested the idea on a small Collection of test data and it appears to work just fine.

     

     

    Distinct(
     Sort(
     Filter('Time Entries',msdyn_bookableresource.'Primary Email'=CurrentUser.Email),
     msdyn_date
     ),
     Text(msdyn_date,"[$-en-US]mmm") & " " & Text(msdyn_date,"[$-en-US]yyyy"))
    )

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

  • yichingjc Profile Picture
    67 on at

    @mdevaney I did try it. but I think my sorting was incorrect that's why it didn't work.  But yours did. Thank you! 

  • mdevaney Profile Picture
    29,989 Moderator on at

    @yichingjc 

    Good to see its working now!

  • yichingjc Profile Picture
    67 on at

    @mdevaney I have another question on relating to Dropdown default.  I've used your code I'm able to sort by month (thanks) see screenshots.  Is it possible to set the Default to be the current month?

     

     
  • mdevaney Profile Picture
    29,989 Moderator on at

    @yichingjc 

    You could likely change the Default property of the ComboBox to this code.

     

    Text(Today(),"mmm yyyy")

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard