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 / My Sort function is ta...
Power Apps
Unanswered

My Sort function is taking the Number Value as Text and not as Values

(0) ShareShare
ReportReport
Posted on by 214

Hi All,

My Sort function is taking the Value digits as text and sorting them as text and not as real Values.

 

Example

100

100000

222

333

 

and not as

100

222

333

100000

 

Any ideas on what I can try to fix this?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Multiply it by*1

  • mahoneypat Profile Picture
    1,720 on at

    You could use AddColumns to convert your text to numbers and sort by that.  In the example below, a table of numbers as text are converted to numbers with Value for sorting (confusing but the name of the column of the initial table is also called Value).

     

    SortByColumns(AddColumns(["100", "1", "22", "33"], "numbers", Value(Value)), "numbers", Descending)

     

    Regards,

    Pat

  • Joorge_c Profile Picture
    214 on at

    Thanks for the replies, I think I know what the issue is

     Im using a switch in the Sort which takes the UpdateContext of the Sort Icon OnChange of varSortG1 and denote the value, which then assign the sorting column. All sorting columns are Text, except for the 'Contract Amount' one with the issue. But if I swap the 'Contract Amount' at 1st, the sorting works on the Digits without issues.

     

    Sort(
    Filter(
    CurrentR,
    Entity_x0020_Adjust_x0020_for_x0020_S_x0020_Branches= Entity.Text
    && Agreement_x0020_Type = Dropdown_AgreementType_PSA.SelectedText.Value
    ),
    Switch(varSortG1,"AName",Agreement_x0020_Name,"LOB",LOB,"ANumber",Agreement_x0020_Number,"Account",Bill_x0020_to_x0020_Account_x0020_Name,"CAmount",Contract_x0020_Amount),
    Switch(varSortOrder1,true,SortOrder.Descending,false,SortOrder.Ascending)
    )

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 644

#3
11manish Profile Picture

11manish 626

Last 30 days Overall leaderboard