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 / filter array condition...
Power Automate
Answered

filter array condition miss the last day of the month

(0) ShareShare
ReportReport
Posted on by 413

Hi there. 

In my list I have 2 datetime fields, "Inizio" and "Fine", ad I need to check if the Fine date is after the Inizio Date.

To do this, I need to convert the UTC data in my regional format (UTC+1), with these expressions:

 

convertTimeZone(item()?['Inizio'], 'UTC', 'W. Europe Standard Time', 'dd/MM/yyyy')
convertTimeZone(item()?['Fine'], 'UTC', 'W. Europe Standard Time', 'dd/MM/yyyy')

 

And I have to say that they works fine. 

 

I don't know why, a filter array that I use to filter the data misses the condition if I have the last day of the month to check .LEt me show an example:

 

The condition is:

@greater(convertTimeZone(item()?['Fine'], 'UTC', 'W. Europe Standard Time', 'dd/MM/yyyy'), convertTimeZone(item()?['Inizio'], 'UTC', 'W. Europe Standard Time', 'dd/MM/yyyy'))

 

or if you prefer:

 

Calcioscacchi_3-1676546839932.png

 

Starting data:

Calcioscacchi_0-1676546719488.png

The conversion works fine:

 

Calcioscacchi_1-1676546748090.png

 

but the filter array show only one output:

 

Calcioscacchi_2-1676546782263.png

 

What the hell am i missing? XD

 

 

 

Categories:
  • Verified answer
    Calcioscacchi Profile Picture
    413 on at

    Ok, solved.

    I thing this is a bug, but if I set the converting function as:

     

    convertTimeZone(item()?['Inizio'], 'UTC', 'W. Europe Standard Time', 'yyyy-MM-dd')

     

     

    it works everytime.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Calcioscacchi,

    Thanks for your sharing.

  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    That's not at all a bug, that's the expected behaviour!

     

    In your original post you converted the dates to strings like dd/MM/yyyy

    If you do string comparision, '10/02/2023' is obvoiusly bigger than '09/03/2023'.

    You fixed it by setting the date format to 'yyyy-MM-dd'.

    That means the most significant character of the string is on the left.


    Why do you format the date at all?
    If you don't provide a format, these date functions return a string that is ISO 8601 formatted and works fine for comparisons and sorting.


    Why the timezone conversion?
    If you just want to check, which date is bigger, there is no need to do this.

  • Calcioscacchi Profile Picture
    413 on at

    I agree with you only in one case:

     

    with 

    convertTimeZone(item()?['Inizio'], 'UTC', 'W. Europe Standard Time', 'dd/MM/yyyy')

    I want to say "hey, take this datetime and:

    • convert it to UTC+1 regional zone
    • convert the data format to dd/MM/yyyy."

     

    Then, if instead the function's behaviour is: "hey, take this datetime and:

    • convert it to UTC+1 regional zone
    • remember that data format is dd/MM/yyyy."

     

    then it's not a bug because I misunderstood the last part of the function.

     

    If not, well, I have told to the function how to set the datetimes, I'll aspect a good comparison between them.

    That could be not the best idea in the world, as you say, but who cares.

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
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard