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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Update column by addin...
Power Automate
Unanswered

Update column by adding Date Difference from multiple date columns

(0) ShareShare
ReportReport
Posted on by 517

Hi,

I am working on a SharePoint List with power automate as a workflow.

 

I have layers of approval based on Request Type.

Say, If request type = "Add", there's only one approval, 

and if request type = "Delete", there are 2 layers of approval

 

Now, i have a column where it computes the date/time difference between two columns like I need to get the Created date and the last Completion date of approval.

 

Date/Time type columns:

  • Created
  • Approval_CompletionDate1
  • Approval_CompletionDate2
  • Date/Time Difference

How do I calculate the date/time difference in power automate (like below), what is the right formula?

Date/Time Difference = If Approval_CompletionDate1 is null, Created - Approval_CompletionDate2, Created - Approval_CompletionDate1

 

 

Thanks! 

Categories:
  • manuelstgomes Profile Picture
    6,643 on at

    HI @jaina 

     

    I'll break it down into two parts. First the comparison:

    if(equals(<your date field>,null),<First date diff>, <second date diff>)

     

    You can copy to the expression and insert the date fields. Regarding the data difference its a little bit more tricky. Not to replicate text there's another solution here that expains how to do it. It depends on how you want the data to be compared (minutes, days, etc).

    https://powerusers.microsoft.com/t5/Building-Power-Apps/how-to-get-difference-between-two-dates-in-flow/td-p/283186

     

    You can replace the expression that you get above in the sections above identified by <date diff>.

     

    Can you please check if and let me know if you have any questions?

     

    Cheers
    Manuel

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

  • Gopala_Krishna Profile Picture
    1,495 on at

    @jaina 

    You can do this directly inside a variable using expressions in power automate, go to expressions tab and type if this would invoke the if condition and would ask you to enter the condition to compare that you return a boolean value followed by the action to perform when the value is true and the action to perform when the value is false.

     

    To doing the date difference you should have to use the ticks() function in power automate, more information related to the same can be found - Solved: how to get difference between two dates in flow - Power Platform Community (microsoft.com)

     

    overall your expression would look something like if(empty(Approval_CompletionDate1),Datedifference_1,Datedifference_2) and for performing date difference you would have to incorporate formulas shared in the above blog.

     

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    if the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved

     

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!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 132

Last 30 days Overall leaderboard