cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Calculated Date Field to have incremented date

Hi,

 

I am trying to create a calculated date field which increments by years. I have two date fields; Purchased Date and Expiry Date. I need to increment Purchase date by 4 years to get Expiry Date. Initially, I gave 4 years as unit but months were getting incremented and not years so I changed formula to 48 Months. I used both 'Set' and 'DateAdd' functions and both of them do not work. Expiry date should not be manually entered by the user. It should autopopulate based on Purchased Date and must get added to the table through a new form. Please help.

 

Fomulas that I used:

DefaultDate: DateAdd("Purchased Date", 4, years), DateAdd("Purchased Date", 48, Months), Text(DateAdd("Purchased Date", 48, Months), "dd-mm-yyyy"), If(EditForm.Mode=FormMode.New, Text(DateAdd("Purchased Date", 48, Months), "dd-mm-yyyy"), Parent.Default).

 

Thank you.

 

Regards,

Thushara

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Calculated Date Field to have incremented date

Hi @Thushara ,

Do you mean that the 'Purchase Date' value is set within your Excel table?

 

Based on the screenshot that you provided, I think there is something error with it. Could you please share more details about the error message within your Expiry Date DatePicker control?

 

Currently, I could not reproduce your issue on my side. Based on the needs that you mentioned, I think the formula I provided above could achieve your needs.

Please set the DefaultDate property of the Expiry Date DatePicker control to following:

DateAdd(PurchaseDatePicker.SelectedDate, 48, Months)

1.JPG

 

Please check if you have referenced proper Purchased Date value within your Edit form.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Calculated Date Field to have incremented date

Hi @Thushara ,

Could you please share a bit more about your data source?

How do you submit data into your data source? Using Edit form?

Further, how do you pick up a Date for the Purchased Date field within your Edit form? Using DatePicker control?

 

Based on the needs that you mentioned, 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:12.JPG

 

13.JPG

Set the DefaultDate property of the DatePicker control within the Expiry Date data card to following:

DateAdd(DataCardValue11.SelectedDate, 48, Months) /* <-- DataCardValue11 represents the DatePicker control within the Purchased Date data card */

Or

DateAdd(DataCardValue11.SelectedDate, 4, Years)

On your side, you should type:

DateAdd(PurchasedDatePicker.SelectedDate, 48, Months)

Note: The PurchasedDatePicker represents the DatePicker control within the Purchased Date data card within your Edit form. I assume that you pick up the Purchased Date and Expiry Date within your Edit form using DatePicker control.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Calculated Date Field to have incremented date

Hi Kris

 

This is how my form looks:

 

EditAssetInformation-NewForm.jpg

 

I use Excel table as data source and I need to submit this entry into the same table using NewForm, as a new row. Date for 'Purchase Date' is picked from the Excel table. As per the purchase date in the image above, I need to have expiry date autopopulated as 5/9/2023. How do I do it?

 

Thank you.

 

Regards,

Thushara

 

 

Highlighted
Community Support
Community Support

Re: Calculated Date Field to have incremented date

Hi @Thushara ,

Do you mean that the 'Purchase Date' value is set within your Excel table?

 

Based on the screenshot that you provided, I think there is something error with it. Could you please share more details about the error message within your Expiry Date DatePicker control?

 

Currently, I could not reproduce your issue on my side. Based on the needs that you mentioned, I think the formula I provided above could achieve your needs.

Please set the DefaultDate property of the Expiry Date DatePicker control to following:

DateAdd(PurchaseDatePicker.SelectedDate, 48, Months)

1.JPG

 

Please check if you have referenced proper Purchased Date value within your Edit form.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: Calculated Date Field to have incremented date

Hi Kris,

 

Date gets auto-incremented now. I set "DateAdd(DateValue2.SelectedDate, 48, Months)". 

 

Thank you so much for the solution and support.

 

Regards,

Thushara

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,017)