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 / How to find greater da...
Power Automate
Answered

How to find greater date between two dates

(0) ShareShare
ReportReport
Posted on by 52

Please see attached screenshot.

Use Case - there are two columns in Excel name as effective date and expiration date . 

I need to check if effective date is greater than expiration date . 

Set variable expiration date= 10/31/2023.

Need to compare this expiration date to the every effective date present in Excel .

IMG_20240502_202843.jpg
I have the same question (0)
  • Verified answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at

    @aggneha9821 

     

    Try the below approach:

    My excel file looks like below

    Deenuji_1-1714663533405.png

     

    Flow Screenshot:

    Deenuji_0-1714663322036.png

    Code:

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Boot\\IInvoice.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
    LOOP FOREACH CurrentItem IN ExcelData
     Text.ConvertTextToDateTime.ToDateTime Text: CurrentItem['Effective Date'] DateTime=> Date_Eff_Val
     Text.ConvertTextToDateTime.ToDateTime Text: CurrentItem['Expire Date'] DateTime=> Date_Expire_Val
     IF Date_Eff_Val > Date_Expire_Val THEN
     Display.ShowMessageDialog.ShowMessage Title: $'''Info''' Message: $'''Effective Date is greater than Expire Date''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     END
    END

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard