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 / Dates from sharepoint
Power Apps
Answered

Dates from sharepoint

(0) ShareShare
ReportReport
Posted on by 9

Hi All,

 

I have a list with dates.

 

Date:

04/04/2020

04/11/2020

04/18/2020

05/12/2020

 

Now i wish to perform certain actions only if the selected date is the last date or greater date in that month.  For example, if selected date is 04/18/2020 and since there is no date after 18th in April, it should do the subsequent steps.

 

Any easiest way to do it?

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Teja1234 
    I am unclear what context this is being used in so here's a general answer.

     

    If(SelectedDate >= Max(ListName, DateColumn),
     true_condition_code,
     false_condition_code
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Teja1234 Profile Picture
    9 on at

    @ 

    How would i do it if i wish to see if the selected date is max in the month. i.e., if i select 04/18/2020 then it should see in april if it is the maximum we have in april. like wise if we select 05/18/2020, then see if it is the maximum in the month of may an so on.

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Teja1234 ,

    Do you want to compare date with the max date of every month?

    If so, you need to firstly group your data based on month.

    Try this formula:

    AddColumns(GroupBy(AddColumns(test,"month",Month(Date)),"month","dates"),"maxdate",Last(SortByColumns(dates,"Date")).Date)

    //test is my collection name, you could replace with yours

     Then you will get a table like this:

    4302.PNG

     The month column is the date's month, maxdate column is the max date of this month.

    You could use formula like this to justify whether this action perform:

    If(SelectedDate>=LookUp(
     AddColumns(
     GroupBy(
     AddColumns(test,"month",Month(Date)),
     "month","dates" //group based on month
     ),
     "maxdate", 
     Last(SortByColumns(dates,"Date")).Date
     ),//add a column with the max date of the month
     Month(SelectedDate)=month,maxdate
     ),//look up the max date based on selecteddate's month
     true_condition_code,
     false_condition_code
    )

     

     

     

    Best regards,

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard