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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Formula field to calculate the difference in days between two date only fields.

(2) ShareShare
ReportReport
Posted on by 32
Hi!
 
I want to show the age of open deals in Opportunity and the time needed to close Won deals.
 
Trying to create formula fields for this, I'm discovering the DateDiff and many other date functions are not supported in this context.
 
Any ideas on how to achieve this?
 
Thanks.
Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    365 on at
    Power Fx formula columns in Dataverse currently have limited support for certain date functions, including DateDiff.
    To get around this for Opportunities, you should use the Calculated Column feature instead of the "Formula" (Power Fx) column type. Calculated columns support the DiffInDays function, which is exactly what you need.
     
    Why use this over Power Fx?
    • Support: DIFFINDAYS is a native legacy function that works reliably for "Date Only" and "User Local" behaviors.
    • Real-time: It updates whenever the record is retrieved or saved.
    • Simplicity: It handles the math without needing complex workarounds for the missing DateDiff function in the newer Power Fx editor.
       
  • Suggested answer
    Jimmy Passeti Profile Picture
    849 Most Valuable Professional on at
    Hello,
     
    You can use the DateDiff function, but I don't think you'll be able to get what you need because the fields have different formats.
     
        'Created On',
     
    Regards,
    Jimmy Passeti | Microsoft MVP
    ✅ Please mark as Verified if this answered your question!
     
  • Suggested answer
    ManoVerse Profile Picture
    935 Super User 2026 Season 1 on at
    Use a Formula Column with simple date math as there are still some functions are unsupported there:
    like If(Status = "Open", Today() - CreatedOn, Blank())  Date subtraction works when DateDiff is limited for this column.
     
    how you can implement this for your scenario:
    1. Create a custom field: new_closeactualdate
    2. Set it via Power Automate when Opportunity becomes Won , required because Dataverse doesn’t store a usable close date for calculation on opportunity record.
    3. Use a Formula Column:
    If(Status = "Won", new_closeactualdate - CreatedOn, Blank())
     
    *Use Power Automate, as recommended by Microsoft when formula limitations block date logic
    *Calculated columns are not future proof as Microsoft is deprecating them gradually
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 196 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans