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 the date is b...
Power Apps
Answered

check if the date is before or after two weeks from the current week

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, 

 

I'll be creating a validation wherein I need to check if the date is before or after two weeks from the current week. 

Just wondering if there's available function that I can utilize for this requirement. 

 

Thank you in advance.

Categories:
I have the same question (0)
  • KvB1 Profile Picture
    1,596 on at

    You can just compare the date of a record to Today()+14 using If(

    This does require that the column is a date argument, if its Text you'd have to convert it to a Date first.

    Or is this not what you need?

  • JamesYumnam Profile Picture
    on at

    @Anonymous  in addition to Kvb1's answer which compare your date in your record to Today's date, if you want to actually compare out with respect to the current week. then you can use Weekday function. with this, find out the current week's start and end date first. then if you want to compare before, use the start date of the current week minus (-) 14, and if you want to compare after, use the end date of the week plus (+) 14.

  • Verified answer
    ArchitectMadhan Profile Picture
    1,584 on at

    Hi @Anonymous ,

     

    I have used the formula If((Self.SelectedDate>(Today()-14) && Self.SelectedDate<(Today()+14)),Self.SelectedDate,"Select valid date") to show the warning notification on selection of date in the date picker. You have to use the same formula in both OnSelect and OnChange. Apart from this I have also set the Start Year and End Year in advanced properties of date picker to 2021. So that user can see only the current year calendar.

    ArchitectMadhan_1-1626779867934.png

     

    If you find my solution helpful for resolving the issue, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks so much... This helped!!!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 860

#2
Valantis Profile Picture

Valantis 548

#3
Haque Profile Picture

Haque 417

Last 30 days Overall leaderboard