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 / how to add months/days...
Power Apps
Answered

how to add months/days to start date to get end date based on number of month/days picked in another column

(1) ShareShare
ReportReport
Posted on by 88

Hi,

How can I add months/days mentioned in another column to start date to get end date.

I used below formula to get end date.

On Dafaultdate property of end date 

DateAdd(DataCardValue4.SelectedDate,6,Months)

 

This is working fine.

 

But I am looking for the result as below,

Suchithra_A_0-1595334816258.png

 

I want to add number of months picked in the column " Internship/Contract Period" to start date to get end date.

How can I achieve this.

 

Kindly help me on this.

 

Regards,

Suchithra

 

 

 

Categories:
  • ganeshsanap Profile Picture
    1,555 on at

    You can create a variable to store the date value after adding the months you selected from dropdown. Add below formula on "OnChange" property of Internship period dropdown:

     

     

    Set(endDate, DateAdd(DataCardValue4.SelectedDate, Value(DropdownDataCardValue.Selected.Value), Months))

     

     

    Replace "DropdownDataCardValue" with the name of your Internship period dropdown name.

     

    In the date picker for End Date, you then set its Default property to the "endDate" variable, so that when that month value is changed from dropdown, then the date displayed in the picker will be changed as well.

    Reference: DatePicker Change Date Programmatically 


    Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • PVosEska Profile Picture
    329 on at

    Hi @Suchithra_A ,

     

    Could you try the following formula on your EndDate dropdown? I have testen it on my side and it works as expected:

     

     

     

     

    DateAdd(DatePicker.SelectedDate,DataCardValue4.Selected.Value,Months)

    DatePicker.SelectedDate = the startDate,

    DataCardValue4.Selected.Value = the months you want to add ( If they choose the amount of months in the internship period field,

    Months = the unit of measurement.

     

    Hope this helps, let me know if you need more.

     

    Regards,

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@Suchithra_A,

    Based on the issue that you mentioned, do you want to add a month number to StartDate in order to get the date from EndDate?

    Could you please share more about your Internship/Contract Period, is it a Choice column?

    @ganeshsanap provides the correct direction, however, DateAdd() expects the number value. You should convert Text value to Number value.

    I have a test on my side, please take a try as below.

    Set OnSelect property of the corresponding DataCardValue to the Internship/Contract Period ComboBox control as below

     

    Set(EndDate, DateAdd(DataCardValue6.SelectedDate, Value(DataCardValue5.Selected.Value), Months))

     

    Set the DefaultDate property of the corresponding DataCardValue to the End Date DatePicher as below

     

    EndDate

     

    Note:

    • DataCardValue6 is the corresponding DataCardValue to Start Date control, 
    • DataCardValue5 is the corresponding DataCardValue to Internship/Contract Period ComboBox control

    Please check the GIF for reference.0722Gif1.gif

    Best Regards,

    Qi

     

  • AshROC Profile Picture
    30 on at

    Dear Qi,

     

    After following your method, i found out my EndDate is just adding the months. How do I solve this?

    2022-07-26 15_51_35-Power Apps and 145 more pages - Work - Microsoft​ Edge.png

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
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard