web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Creating a sortable field for days since modified?

(0) ShareShare
ReportReport
Posted on by 10

We have a need for a field to show the number of days since an opportunity was modified. however we would like to sort a view based on this table. this seems easy enough, I created a calculated field to calculate the difference between DateModified and NOW(). This works great except you can not use it to sort a view. My best guess is Dynamics treats either DateModified or NOW as a calculated field and will not allow sorting by a calculated field if it relies on another entity or another calculated field (this is listed in the documentation.

so the question is, is there any work around?

  • Community Member Profile Picture
    on at

    Hi jdetmold,

    Yes, I tested it and it couldn't be sorted in the view. There's a limitation that can’t use values in calculated columns on a logical value in the same table to sort data returned by a query as the doc says:

    Calculated and rollup columns (Microsoft Dataverse) - Power Apps | Microsoft Docs

    You could create another non-calculated whole number field and use a business rule/workflow to populate the value to be the same as the calculated field.

    Please refer to this link:

    Sorting a calculated field in a view in unified interface | Customer Engagement & Dynamics CRM Forum (crmug.com)

  • jdetmold Profile Picture
    10 on at

    unfortunately changing a field from a workflow changes the date modified value and makes the data no good

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I believe you will need to develop the plugin that will do that "calculation" job for you. The key point - it has to be "pre-update" plugin and set the field using the context.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
ParthPatel249 Profile Picture

ParthPatel249 64

#1
11manish Profile Picture

11manish 64 Super User 2026 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 46 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans