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 Apps / Check if dates are in ...
Power Apps
Unanswered

Check if dates are in chronological order in a collection

(1) ShareShare
ReportReport
Posted on by 9
Team,
I have a problem and I would like to ask for your help:
I need to check that the dates in a collection are in chronological order (only when STATUS column is COMPLETED) and, if not, set a variable to "false".
My collection has 3 columns, as in the example below:
 
ORDERDATESTATUS

1

01/02/2020Completed
203/02/2020Completed
307/02/2020Completed
405/02/2020Completed
509/02/2020Completed
6 Awaiting
7 Awaiting

Thank you very much for any help you can give me.
Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @pquateli 

     

    What is the data source and what is the type of Status columns?

     

    If the Status is text column, please try this, put the codes to button OnSelect:

     

    Clear(Result);ForAll(Filter('Table',STATUS="Completed"),Collect(Col_LoopNo,1);If(Last(FirstN(Filter('Table',STATUS="Completed"),CountRows(Col_LoopNo))).DATE=Last(FirstN(SortByColumns(Filter('Table',STATUS="Completed"),"DATE1",Ascending),CountRows(Col_LoopNo))).DATE,Collect(Result,true),Collect(Result,false)));If(false in Result.Value, Set(VariableName, false))

     

    If dates in a collection are not in chronological order, it will set false to the variable.

    Sik

  • pquateli Profile Picture
    9 on at

    Thanks Sik, I'll try.

    Original data is in SharePoint list and Status column is text.

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

    Hi @pquateli 

     
    How about your issue?
    Does the workaround above suit for your case?
    Sik

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard