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 / Fuction IF - I need help
Power Automate
Unanswered

Fuction IF - I need help

(0) ShareShare
ReportReport
Posted on by 102

I need help! I need to create a function that solves this need.

I have a file and I need to know : If it was created in the current month in the previous month or before the previous month

Example: A file is created in 30/11/2022, a result the fuction is previous month

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

    Hi @jurunas2023,

     

    You could use a formatdatetime function with a MM format together with the Created property and compare it with the UtcNow function with the same MM format (after some calculation to determine the previous month). This way you can check if this is the previous month.

     

    Below is an example

    If the condition matches it will be the previous month and the flow will go to the If Yes section.

     

    formatdatetime(item()?['Created'], 'MM')

    is equal to

    formatdatetime(addDays(startofMonth(utcNow()), -1), 'MM')

     

    previousmonthcheck.png

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 305 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 155 Most Valuable Professional

Last 30 days Overall leaderboard