Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

SortByColumns NOT Sorting by Column name Date but Sorting by ID

(0) ShareShare
ReportReport
Posted on by 195

Hello Powerapps Experts, 

Good day! 

I would like to seek your help regarding sortbycolumns.  So I used my Code below. 

SortByColumns(
 Filter(
 colRPNViewItems,
 Team = Cmb_Team.Selected.Result || Cmb_Team.Selected.Result = Blank(),
 Originator = Cmb_Originator.Selected.Result || Cmb_Originator.Selected.Result = Blank(),
 IncidentType = Cmb_AlertType.Selected.IncidentType || IsBlank(Cmb_AlertType),
 (DateValue(NewIncidentDate) >= DatePicker_StartDate.SelectedDate && DateValue(NewIncidentDate) <= DatePicker_EndDate.SelectedDate),
 IncidentModule in multiselectModule.Result || IsBlank(Cmb_Module),
 PrimaryDropDown = Cmb_PrimaryCause.Selected.Result || IsBlank(Cmb_PrimaryCause),
 Brand in multiselectBrand.Result || IsBlank(Cmb_Brand),
 (PlantID = Dd_Plantid_2.Selected.PlantID || IsBlank(Dd_Plantid_2.Selected.PlantID)),
 IncidentModule in multiselectModule.Result || IsBlank(Cmb_Module)
 ),
 "DateEntered",
 If(
 locSortAscending,
 Ascending,
 Descending
 )
 )

 

But the result order is not in proper order. Instead it was sorting by ID column rather than DateEntered.

 

YamiteKudasai_0-1661265127896.png

 

 How to solve this issue? Thanks in advance for your help.


Categories:
  • haris00000001 Profile Picture
    haris00000001 85 on at
    Re: SortByColumns NOT Sorting by Column name Date but Sorting by ID

    Please follow this article: 

    haris00000001_0-1661327424652.png

    https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-sort

     

  • Verified answer
    Gochix Profile Picture
    Gochix 1,933 on at
    Re: SortByColumns NOT Sorting by Column name Date but Sorting by ID

    Hi @YamiteKudasai ,

     

    Possibly something wrong with your Filter formula?

     

    Try to add bit by bit to your filter and see if there is a problem.

    Working fine with a test :

     

    Gochix_0-1661266772045.png

    Source:

    Gochix_1-1661266793694.png


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

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

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,858

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,505

Leaderboard