Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

  • Expiscornovus Profile Picture
    31,648 Most Valuable Professional on at
    Re: Fuction IF - I need help

    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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,708 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,030 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow