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 / Why date comparison is...
Power Automate
Answered

Why date comparison is not working in Filter Array - this should be simple?

(0) ShareShare
ReportReport
Posted on by 1,259 Moderator

I have an Excel file I am loading and want to filter the FilledDate column so I only get the rows back where the date is 2/13/2022.  When I run this it doesn't return any output, but the flow doesn't crash either.

What am I doing wrong as I copied this example from several postings.

Thank you

 

Here's the filter array:

subsguts_0-1672266403509.png

 

Here's the formula expanded:

addDays('1899-12-30', int(item()?['FilledDate']), 'dd/MM/yyyy')

 

Categories:
  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    you are comparing dd/MM/yyyy against m/d/yyyy.

     

    Better to always use ISO8601 format.

  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @subsguts 

     

    You need to change the right side of the filter array to:

    formatDateTime('2/13/2022','dd/MM/yyyy')

     

    Best Regards,

    Levi

  • subsguts Profile Picture
    1,259 Moderator on at

    I tried this and got the same results?  Any other suggestions?

  • subsguts Profile Picture
    1,259 Moderator on at

    I tried changing all the date formats to be ISO8601 and it still didn't return any results.  I'm really not sure why this doesn't work as it is a cut&paste from a video about this type of thing.  Any help is greatly appreciated as I'm beating my head against the wall on this one.

     

  • subsguts Profile Picture
    1,259 Moderator on at

    Not sure if this will help, but here is what the dates look like in Excel:

     

    subsguts_0-1672323474154.png

     

  • subsguts Profile Picture
    1,259 Moderator on at

    I even tried changing the formula to compare against the number and it isn't filtering out the rows:

     

    Here's one of the "FilledDate" values:

     

    subsguts_0-1672324252157.png

     

    Here's the Filter Array:

     

    subsguts_1-1672324373863.png

     

    I must be missing something as this shouldn't be this hard, right?

  • Verified answer
    subsguts Profile Picture
    1,259 Moderator on at

    @v-liwei-msft @lbendlin , Thank you both for the direction, after several more hours of work, I finally got it to work.

     

    Here is the solution, which really combines parts of what you both said:

     

    1.  You need to ensure both of these are put in as formulas as shown below.  It doesn't appear to work if you type it in as it causes the code to not be correct, at least that's my assumption based on a "peek" at the code

     

    subsguts_0-1672329255061.png

    2.  The following are the two formulas, and what I found is you need to ensure that the format in the first formula and the format in the second formula need to match exactly.  It doesn't appear to matter which format you use, but they must match.

     

    First formula: addDays('1899-12-30', int(item()?['FilledDate']), 'M/d/yyyy')
    2nd formula: formatDateTime('12/21/2021', 'M/d/yyyy')

     

    Thank you again, and I hope this helps others save hours of time and that maybe MS will improve this so it's not so difficult as I believe this shouldn't require such complexity.

     

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard