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 / Change this formula to...
Power Automate
Unanswered

Change this formula to -7 days

(0) ShareShare
ReportReport
Posted on by 63

Hello,

 

Is anyone able to change the below formula so it collects data for the previous 7 days please?

 

 

 

@And(not(equals(length(item()?['Date']), 0)),equals(formatDateTime(item()?['Date'], 'dd/MM/yyyy'), formatDateTime(utcNow(), 'dd/MM/yyyy'))) 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @MarkCoates,

     

    You could use the addDays functions an substract 7 days. With greaterorequals and lessorequals you can check if the detail is within the last 7 days time range.

     

    Try an expression like below:

    @and(and(not(equals(length(item()?['Date']), 0)), greaterorequals(formatdateTime(item()['Date'], 'yyyy-MM-dd'),addDays(utcNow(),-7, 'yyyy-MM-dd'))),lessorequals(formatdateTime(item()['Date'], 'yyyy-MM-dd'),utcNow('yyyy-MM-dd')))

     

  • MarkCoates Profile Picture
    63 on at

    Thank you very much @Expiscornovus - Also, would you happen to know, in the automatic e-mail I send at the end, how would i be able to show "Please see report from 'Date' to 'Date'"

     

    First date being 7 days ago and 2nd date being today? 

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard