cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fcnchuck
Regular Visitor

Sort multiple Cascade DropDowns

 

Sort(Distinct(Filter(Source1, 'Employee' = Employee.Selected.Result And Division = Division.Selected.Result And 'Office' = Office.Selected.Result),'Cost'), Ascending)

 

Above is what i am using and the returned data is correct. But i cannot get the data to sort properly either Ascending or descending order. I have tried to use Sort either before or after Distinct( but it does not make a difference.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @fcnchuck ,

The right syntax of Sort should be like:

Sort( Table, Formula [, SortOrder ] )

While in your formula, you are lack of the second parameter.

Please try this formula:

Sort(Distinct(Filter(Source1, 'Employee' = Employee.Selected.Result And Division = Division.Selected.Result And 'Office' = Office.Selected.Result),'Cost'), Result,Ascending)

Here's a doc about this function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-sort

 

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
PowerAddict
Super User II
Super User II

Are you getting an error? I see a few missing parenthesis. Unless I missed something I didnt see where you have specified the column to use for sorting.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

No error. All data is returned, just not sorted alphabetically.

 

Maybe that is what i am missing. This drop down has values that are determined by the 2 preceding drop down selections. So the data that is shown should be sorted against itself i suppose?

I will have yo check this on my computer but Sort requires an expression to sort by and SortBy requires a column name to sort by.

I will get back to you in a few minutes.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com
v-yutliu-msft
Community Support
Community Support

Hi @fcnchuck ,

The right syntax of Sort should be like:

Sort( Table, Formula [, SortOrder ] )

While in your formula, you are lack of the second parameter.

Please try this formula:

Sort(Distinct(Filter(Source1, 'Employee' = Employee.Selected.Result And Division = Division.Selected.Result And 'Office' = Office.Selected.Result),'Cost'), Result,Ascending)

Here's a doc about this function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-sort

 

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you so much. I figured it was one parameter i was missing. 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (17,604)