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 / SortByColumns Ascendin...
Power Apps
Unanswered

SortByColumns Ascending/Descending not working properly

(0) ShareShare
ReportReport
Posted on by 44

Hello!

 

I'm having problems using the SortByColumns function, ascending and descending work correctly only for values below 10. Is it a bug or am I doing something wrong?

 

The code in the Gallery Items and table:

IsabellaFranco_0-1671477764794.png

 

 

 

 

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    @IsabellaFranco this could be caused due to the prof_inicial being defined as text and not numbers.

    Could you give the code below a try:

    Sort(ColSondagem; Value('Prof_inicial'); Ascending)

     

    If this solves your question, would you be so kind as to accept it as a solution.
    Thanks!

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi @IsabellaFranco the solution by @LaurensM is 100%. you may want to consider changing the type of that column to a numeric one unless it needs to be text for a specific reason.

  • IsabellaFranco Profile Picture
    44 on at

    Well, I found an alternative with the help of @LaurensM 's solution, but I still don't understand why the first code didn't work... The column was already numeric so I just used "Sort(ColSondagem; "prof_inicial"; Ascending)" and it worked. But is it correct not to work with SortByColumns?

  • LaurensM Profile Picture
    12,516 Moderator on at

    @IsabellaFranco I was unable to recreate that specific issue.

     

    When the field is defined as numeric, both Sort() and SortByColumns() worked fine.

    If the field was Text then I had a similar issue both for Sort() and SortByColumns().

    Nevertheless, I am glad the issue is resolved.

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