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 / Filter and Sort My upd...
Power Apps
Answered

Filter and Sort My updatecontext(SortDescending1:!SortDescending1) doenst work if all is selected

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi can someone help me with this,

 

My update context (sort button) doesnt work when my dropdown is on ALL only when its on the other values?

If(StatusDropdown.Selected.Value = "ALL", 'Work Order', SortByColumns(
 Filter(
 'Work Order',
 ManagementStatus.Value = StatusDropdown.Selected.Value,
 StartsWith(
 PONumber,
 TextSearchBox1.Text
 )
 ),
 "Work_x0020_Date",
 If(
 SortDescending1,
 Descending,
 Ascending
 )
))
Categories:
  • WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Hi @Anonymous ,

    Check all the brackets - but the sort only applied to the second part in your code.

    If(
     StatusDropdown.Selected.Value = "ALL", 
     SortByColumns(
     'Work Order',
     "Work_x0020_Date",
     If(
     SortDescending1,
     Descending,
     Ascending
     )
     ), 
     SortByColumns(
     Filter(
     'Work Order',
     ManagementStatus.Value = StatusDropdown.Selected.Value,
     StartsWith(
     PONumber,
     TextSearchBox1.Text
     )
     ),
     "Work_x0020_Date",
     If(
     SortDescending1,
     Descending,
     Ascending
     )
     )
    )

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    The reason why you met this problem is that SotByColumns function only contains the second part in your formula, it doesn't contains the first part "StatusDropdown.Selected.Value = "ALL", 'Work Order'".

    I suggest you combine two parts together and make the SotByColumns function contains both of them.

    I think this formula is simpler:  (just need to change the sortbycolumns function position)

    SortByColumns(
     If(StatusDropdown.Selected.Value = "ALL", 
     'Work Order', 
     Filter(
     'Work Order',
     ManagementStatus.Value = StatusDropdown.Selected.Value,
     StartsWith(
     PONumber,
     TextSearchBox1.Text
     )
     )
     ),
     "Work_x0020_Date",
     If(
     SortDescending1,
     Descending,
     Ascending
     )
    )

     

     

    Best regards,

  • WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Yep @v-yutliu-msft ,

    That is simper for @Anonymous ,

    I was not on a PC so supplied something I knew would work.

    I have had issues in the past with conditions in the middle of filters.

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

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard