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 / Calculate date field b...
Power Apps
Answered

Calculate date field based on another date

(0) ShareShare
ReportReport
Posted on by 31
Hi everyone I am customizing a SharePoint list form using PowerApps and have so far been unable to do the following. I have two date fields - Date 1 and Date 2. When a user enters a date into Date 1 I want Date 2 to be automatically populated with a date that is 30 days after Date 1. Is this possible, and if so, how do I do it? Thanks in advance for your help.
Categories:
  • Mike8 Profile Picture
    1,330 on at
    Hello, You can try this: Datepicker2.DefaultDate = DateAdd(DatePicker1.SelectedDate,30,Days)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @gjayne84,

    Based on the needs you provided, I think the DateAdd function could achieve your needs.

    I have made a test on my side, please take a try with the following workaround:13.JPG

    Set the DefaultDate property of the second DatePicker control to following:

    DateAdd(DatePicker1.SelectedDate,30,Days)

    On your side, you should set the DefaultDate proeprty of the DatePicker control within the Date 2 Data card to following:

    DateAdd(DatePicker1.SelectedDate,30,Days)

    More details about the DateAdd function, please check the following article:

    DateAdd function

     

    In addition, you could also consider take a try to set the OnChange property and OnSelect of the DatePicker control within the Date 1 Data card to following:

    Set(PopulatedDate, DateAdd(DatePicker1.SelectedDate,30,Days))

    Set the DefaultDate proeprty of the DatePicker control within the Date 2 Data card to following:

    PopulatedDate

     

    Best regards,

    Kris

     

  • ninjasword341 Profile Picture
    2 on at

    This is great information. I have a different scenario I need help with, if anyone has any ideas

     

    Three total fields for a device purchase date, years covered for warranty, and expiration date.

     

    So basically if purchase date is 5/5/2020 selected from date picker, with a (2) for 2 years entered numerically in second field. I need the third expiration date in the third field to auto-calculate expiration date at 5/5/2022.

     

    Any takers?

  • Benmo33 Profile Picture
    13 on at

    Hi, what should I do if my number of days will be different based on dropdown selected value?

    for example: if my drop down selected value is ABC then add 14 days and  if my drop down selected value is XYZ then add 30 days.

     

    Thank you

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 Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard