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 / Use calculated date to...
Power Apps
Answered

Use calculated date to show another field in view or edit mode within 2 week window

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a power app linked to a sharepoint list.  I have a calculated date field in the share point list. What I am trying to do is if today's date is within 2 weeks (1 week prior and 1 week after) of the calculated date I want the field to be in edit mode. If today is not within that 2 week window I want the field to be view only.

this is what I have come up with. The calculated date in this formula is '4 Mth Date'. This is not working.

If(DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue('4 Mth Date'))>0,DisplayMode.Edit,DisplayMode.View)

Any ideas?  I am trying to put this on the card's display mode.

 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    If I understand you on this, you're looking for a datacard to be in edit or view mode based on the record date (in your calculated date) being within a 1 week (7 day) before or after today's date window.  

     

    If so, then consider this formula:

    If(Abs(DateDiff(DateValue('4 Mth Date'), Now(), Days)) > 7, View, Edit)

    This will determine the number of days (DateDiff) between now and the calculated date.  It then takes the Abs value (positive value) of that DateDiff.  If it is greater than 7 (more than a week), then it will be in View mode, otherwise it will be in Edit mode.

     

    I hope this is helpful for you and clear.

     

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard