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 based on numberic...
Power Apps
Answered

Sort based on numberic calcualted column is not working for negative numbers

(0) ShareShare
ReportReport
Posted on by 3,514

I have sharepoint custom list with 3 columns:-

 

1) ScoreGreenPoint --> of type number

2) ScoreRedPoint --> of type number

3) ScoreFinalScore --> of type calcualted

 

sort.png

 

 

and inside the PowerApp i am sorting based on the above calculated column, as follow:-

 

sorted.png

but the sorting is not working for negative numbers!!  because -1 (1 green point - 2 red points) is larger than -5 (5 green point with 10 red point)!!  any advice?

 

Categories:
  • WarrenBelz Profile Picture
    156,730 Most Valuable Professional on at

    Hi @johnjohn123 ,

    Try to keep away from using SharePoint calculated columns in Power Apps (they will not perform as expected) and do the calculation in Power Apps instead. I would recommend default a number field in SharePoint to the calculation and Patch it with the calculation when anything is changed affecting it.

     

    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.

  • johnjohn123 Profile Picture
    3,514 on at

    @WarrenBelzto be honest it is weried that such a straightforward sorting will not work.. so how i can do the calculation inside power app and then sort based on the result?

     

    I tried these formuals:-

     

    SortByColumns(Scores,"ScoreGreenPoint"-"ScoreRedPoint",Descending)

    SortByColumns(AddColumns("Scores","ScoreFinalScore",Value(Effect)),"ScoreFinalScore",Descending)

     

     

    I also created a Label with this formual:-

    tjhis.png

     

     

    then i used this formula:-

     

    SortByColumns(Scores,Label2,Descending)

     

    but did not work !

     

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

    Hi @johnjohn123 ,

    I was referring to making the same calculation as the SharePoint calculated column in Power Apps then populating a number field with it (on all records). You would then sort on this column.

    What I was pointing out was that there are column type in SharePoint that are really only useful in SharePoint and if referenced in Power Apps cause unwanted hardship. I have done a blog on this if it is useful to you.

     

    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.

  • johnjohn123 Profile Picture
    3,514 on at

    @WarrenBelz  can you advice more on how i can implement this:-

     

    "making the same calculation as the SharePoint calculated column in Power Apps then populating a number field with it (on all records). You would then sort on this column."

  • Verified answer
    WarrenBelz Profile Picture
    156,730 Most Valuable Professional on at

    @johnjohn123 ,

    On second thoughts now I see how simple the formula is, you could use AddColumns() and do this

    SortByColumns(
     AddColumns(
     Scores,
     "SortField"
     ScoreGreenPoint-ScoreRedPoint
     ),
     SortField,
     Descending
    )

     

    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.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard