web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Calculate date field b...
Power Apps
Unanswered

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:
I have the same question (0)
  • 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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard