Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Sorting on calculated filed is not working in power apps portal

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




Solution Supplier
Solution Supplier

Hi @praneshJ,

This most likely falls under the limitations defined here:


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

Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (11,344)