Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Unanswered

Sorting on calculated filed is not working in power apps portal

(0) ShareShare
ReportReport
Posted on by 121

Hello Experts,

 

I have calculated filed (Datatype: Whole Number) named 'week number' in one of my entity in CDS. in that calculated filed I am pulling the 'week key' from another entity(DimWeek), and I am pulling that calculated filed in one of the view which is used in Entity list to display data on the web page.

 

I want to sort the records in the entity list on the basis of calculated field 'week number' (descending), but when I am sorting records on that field the entity list is not getting sorted, but when I tried sorting the entity list on the other field it is getting sorted.

it seems strange to me,

 

What was wrong with that field I am not sure.

 

any quick help on this is really appreciable!!

 

please check the below screen shot in which we have sorted the records in the view both way (smaller to larger / larger to smaller)

Larger to Smaller.

sorting 2_censored.jpg

 

Smaller to Larger

sorting 1_censored.jpg

 

Regards,

Pranesh 

  • justinburch Profile Picture
    Microsoft Employee on at
    Re: Sorting on calculated filed is not working in power apps portal

    Hi @praneshJ,

    This most likely falls under the limitations defined here: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/calculated-rollup-attributes#limitations

    Limitations

    You can’t use values in calculated attributes that reference a related entity, another calculated attribute, or a logical value in the same entity to sort data returned by a query. Although your query can specify that the results should be ordered using a calculated attribute, the sort direction will be ignored and will not throw an error. If the calculated attribute references only simple values in the same record, sorting works normally. You can determine the sources used in a calculated field using the SourceTypeMask property on the attribute metadata. More information: Logical attributes

    Only attributes from an immediate parent entity can be used in a calculated attribute.

    Saved queries, charts, and visualizations can have a maximum of 10 unique calculated attributes.

    Calculated attributes can reference other calculated attributes in their formula, but they can’t reference themselves.

    Calculated attributes don’t have values when a user with Dynamics 365 for Outlook is offline.

    MaxValue and MinValue metadata properties can’t be set on calculated attributes

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35