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 / SortByColumns Cant wor...
Power Apps
Answered

SortByColumns Cant working for me

(0) ShareShare
ReportReport
Posted on by 19

SortByColumns(
Filter('DataBase_Name',
Status.Value="inprogress"
)
,SessionDate
,Descending
)

 

What is the problem? 

 

Error message: 

Kuszika54_0-1669637785707.png

 

can you help me? 

 

Thanks

Categories:
  • FernandoTC Profile Picture
    222 on at

    Hi @Kuszika54 

     

    SortByColumns needs you to specify the columns between quotation marks. Try:

     

     

    SortByColumns(
    Filter('DataBase_Name',
    Status.Value="inprogress"
    )
    ,"SessionDate"
    ,Descending
    )

     

    Regards

  • Kuszika54 Profile Picture
    19 on at

    Unfortunatly same error message. 

  • FernandoTC Profile Picture
    222 on at

    Ok then I'll need more info.

     

    Which data source are you using? Sharepoint, SQL?

    Which data type is the Status field you are using in the filter?

     

    Regards

  • Kuszika54 Profile Picture
    19 on at

    I use Sharepoint database. Status field is a dropdown. 

     

  • Verified answer
    FernandoTC Profile Picture
    222 on at

    Ok.


    The formula synthax seems to be ok. Maybe its the column name the thing that is failing. Sometimes if you change the name of a SP list column the old name remains untouched.

     

    Since you are sorting by only one column, you can use the Sort() function instead.

     

    Try:

    Sort(
    Filter('DataBase_Name',
    Status.Value="inprogress"
    )
    ,SessionDate
    ,Descending
    )

     

    Notice the Sort instead of SortByColumns and the column not between quotation marks. If this doesnt work, power apps sould suggest you the available column names you can use within the column parameter of the function.

  • akhaneja Profile Picture
    19 on at

    Hello Fernando TC,

     

    I'm also facing some issues with sort by column. The above Syntex works with some column names but not for others Column name, please see attached image.

    This Condition Working:- 

    FirstN(
    SortByColumns(
    Filter(
    OfficeBooking1,
    BookDate = BookingDate_1.SelectedDate
    ),
    "BookDate",
    SortOrder.Ascending
    ),

    10

    )

     

    But not for this column name:- 

    FirstN(
    SortByColumns(
    Filter(
    OfficeBooking1,
    BookDate = BookingDate_1.SelectedDate
    ),
    "DeskName",
    SortOrder.Ascending
    ),
    45
    )

    Thank you 

    Screenshot 2023-07-17 102530.jpg

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard