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 / (dateadd( dtpstartdate...
Power Apps
Unanswered

(dateadd( dtpstartdate.selecteddate(7),timeunit.days)) error fomula

(0) ShareShare
ReportReport
Posted on by
how do i resolve this date due formula on fx, the ''dtpstartdate'' is not fetching, hence the formula ''dateadd(
dtpstartdate.selecteddate(7),timeunit.days)'' is giving an error
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    This format should work
    DateAdd(
       dtpstartdate.SelectedDate,
       7,
       TimeUnit.Days
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • IW-11020819-0 Profile Picture
    2 on at
    Hello,
     
    I have the same problem. FX does not find "SelectedDate". It is not suggested and marked as an error. The properties of the card is shown as Date Picker. I could not find a solution so far.
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    If dtpStartDate is that Classic Date Picker control above the control with the formula, then that is perfectly valid code and should not error. I suggest you try with two new date pickers as something may be corrupt. I will add below the actual code from your uploaded image as it is different in your post
    DateAdd(
       dtpstartdate.SelectedDate,
       7,
       TimeUnit.Days
    )
    
  • Apurva Profile Picture
    91 on at
    If dtpStartDate.SelectedDate is Blank(), the DateAdd function will throw an error. 

    To handle this, try the following approach and please let me know if it works:

    If(IsBlank(dtpStartDate.SelectedDate), Blank(), DateAdd(dtpStartDate.SelectedDate, 7, TimeUnit.Days))

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    An empty date picker should not cause that error - test below
     
     
     
  • CU17020509-0 Profile Picture
    2 on at

    The issue you're facing with the formula might stem from how the dtpstartdate is being referenced. When using formulas like dateadd(dtpstartdate.selecteddate(7), timeunit.days), it’s important to ensure that the syntax is correct and the dtpstartdate control is being properly referenced. The formula you're using seems to be incorrectly written, and that's why it's giving you an error.

    The correct approach would be something like this:

    DateAdd(dtpstartdate.SelectedDate, 7, TimeUnit.Days)
     

    DateAdd(dtpstartdate.SelectedDate, 7, TimeUnit.Days)

    Here, dtpstartdate.SelectedDate gets the selected date from the dtpstartdate control. Then, DateAdd adds the specified number of days (7 in your case) to that date, with TimeUnit.Days defining that you're adding days.

    Another key thing to check is whether the dtpstartdate control actually has a valid date. If the control is not initialized with a date or is left empty, that could lead to errors as well. Be sure that the date picker control is set with a valid date before attempting to use it in a formula.

    Lastly, it's also essential to ensure that the environment you're working with (like PowerApps, Excel, or another platform) supports this syntax. Different platforms may have slightly different ways of handling date and time functions, so it's worth checking the documentation for the specific platform you're using.

    If you're still running into trouble, it would be helpful to know the specific platform you're working with, and I can assist you further from there!

  • timl Profile Picture
    36,415 Super User 2025 Season 2 on at
     
    I recognise your question from the exercise in the Power Up program.
     
    At around 6:20 into Video 6, the instruction is to rename the auto-generated date picker to dteStartDate
     
    It's possible that you selected the parent card rather than the date picker during this rename process. If that's the case, that would explain the problem.
     
    Therefore, I would double check that you renamed the correct control.
     
     

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard