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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Expression to subtract...
Power Automate
Unanswered

Expression to subtract the date of "created on" from current time

(0) ShareShare
ReportReport
Posted on by 1,710

Hello,
I have created a flow that will filter all the active cases in an entity and display them in an HTML table.

What I want to achieve is the following:

  • I would like to subtract the UTC now() date and the date that the case was created on.
    The default column expression of "Created on" column is the following:

Capture.PNG

Capture.PNG

  • Besides, after the estimation is completed I want to concatenate to the result, "Day" if it's less than one, and Days if it's greater than one.

What could be the expression for this scenario?
Can please someone provide an example?

 

Any help will be greatly appreciated.
Thank you!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hello @Julien2 

     

    You can use the expression: 

    addDays(utcNow(),-7,'dd/MM/yyyy')
     
    This will subtract 7 days off today's date, for you pre-defined date you would replace utcNow() with your field.
     
    Hope this helps 🙂
     
    Thanks

    Bradley
  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Julien2 

     

    Thanks for the screen share.

     

    The below expression will give you the number of days.

    div(sub(ticks(formatDateTime(utcNow(),'yyyy-MM-dd')),ticks(formatDateTime(items('Apply_to_each')?['createdon'],'yyyy-MM-dd'))),864000000000)
     
    Thanks
  • EBMRay Profile Picture
    1,710 on at

    Hello @abm,

     

    Thank you very much for your support!

     

    Regards,

    Julien

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard