Skip to main content

Notifications

Power Pages - Power Apps Portals
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Sort Drop Down - Error - The "Sort"part of this formula might not work correctly on large data sets

Posted on by
I am currently using power apps. I am utilizing a vertical gallery and I have also included a sort drop down. The sort drop down has the following items" ContentViews, ContentRating and ContentUploadDate. I want to be able to sort by each item in descending order. I used the below formula and it seems to only work for one at a time. When I tried to include for content rating and content upload date. It shows error. When I replace the contentviews with contentrating or upload date. It works. But I want to be able to sort by either of the 3. When I include the 3 items for the sorting it doesn't work. It shows delegation warning: The "Sort"part of this formula might not work correctly on large data sets. I would kindly appreciate some help
 
Sort(
    Filter(
    FinanceContentTables,
    (IsBlank(drpTransformationArea.Selected.Value) ||
    'Transformation Area' = drpTransformationArea.Selected.Value)
    && (IsBlank(drpTechnologyplatform.Selected.Value) ||
    'Technology Platform' = drpTechnologyplatform.Selected.Value)
    && (IsBlank(drpTechnologydetails.Selected.Value) ||
    'Technology Details' = drpTechnologydetails.Selected.Value)
    && (IsBlank(drpFinanceprocess.Selected.Value) ||
    FinanceProcess = drpFinanceprocess.Selected.Value)
    && (IsBlank(drpFinanceOrganization.Selected.Value) ||
    FinanceOrganization = drpFinanceOrganization.Selected.Value)
    && (IsBlank(drpComptencylevel.Selected.Value) ||
    CompetencyLevel = drpComptencylevel.Selected.Value)
    && (IsBlank(drpContenttype.Selected.Value) ||
    ContentType = drpContenttype.Selected.Value)
),
If(
        drpSort.Selected.Value = "ContentViews",
        ContentViews,
        If(
            drpSort.Selected.Value = "ContentUploadDate",
            ContentUploadDate,
            If(
                drpSort.Selected.Value = "ContentRating",
                ContentRating,
                ContentViews // Default to ContentViews if none match
            )
        )
    ),
    If(
        drpSort.Selected.Value = "ContentViews" ||
        drpSort.Selected.Value = "ContentRating" ||
        drpSort.Selected.Value = "ContentUploadDate",
        SortOrder.Descending,
        SortOrder.Ascending // Default sort order if none of the above match
    )
)
Categories:

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard