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 Dropdown with Cus...
Power Apps
Answered

Sort Dropdown with Custom Sort

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I need to custom sort my scenarios because 10 is showing before scenario 2 because of the one. I am trying to use this formula, but I am not sure what I am missing. SortByColumns( GUAT, Scenario, [ Scenario 1,Scenario 2,Scenario 3,Scenario 4,Scenario 5 ] )

Categories:
I have the same question (0)
  • eliz_talent Profile Picture
    98 on at

    Can you update names to 01, 02, 03?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, I did that I dont really like the look of it. This is my items for the gallery - Filter(
    collGUAT2MasterData,
    If(
    IsBlank(ComboBox1_3.Selected.Result) || ComboBox1_3.Selected.Result = "All",
    true,
    C4 in ComboBox1_3.SelectedItems
    ) && If(
    IsBlank(Dropdown1_1.Selected.Result) || Dropdown1_1.Selected.Result = "Scenario",
    true,
    C5 in Dropdown1_1.Selected.Result
    ) && If(
    IsBlank(Search__1.Text),
    true,
    Search__1.Text in C2
    ) && If(
    IsBlank(ComboBox1_4.Selected),
    true,
    C3 in ComboBox1_4.SelectedItems.Value
    )
    ). The dropdown is dropdown1_1 and then in onvisible I have Collect(
    coll,
    Sort(
    Distinct(
    GUAT2,
    Scenario
    ),
    Result
    )
    ); and ClearCollect(
    coll,
    {Result: "Scenario"}
    ); so the items for the dropdown are coll. I really don't want the 0 in front of it. @eliz_talent 

  • eliz_talent Profile Picture
    98 on at

    What I can suggest, according to the Power BI logic of sorting, is that the solution could be adding a column that will match usual order 1,2,3,4,....

    So, you need to store this column together with your items

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Do you want to sort the items in the dropdown box? Are the Items actually be {scenario 1, scenario 2, scenario 3, scenario 4, scenario 5}?

     

    You can leverage below formula to sort the table by a single column table, but needed to Quote the column name and field contents of the single column table:

     

    SortByColumns( GUAT, “Scenario”, [ “Scenario 1”,”Scenario 2”,”Scenario 3”,”Scenario 4”,”Scenario 5”])

     

    But since you have 14 scenarios to be sort, it is a little too complicated to list all items in the formula. Please try below formula to sort by a single number value split from the items:

     

    Sort(AddColumns(coll,"Number",Last(Split(ThisRecord.Value," ")).Result),Value(Number))

     

    If they are not exact what you listed, please show me the details about the items. 

     

    Best regards,
    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution  to help the other members find it more.

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

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard