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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Formula help - DateAdd

(0) ShareShare
ReportReport
Posted on by 240

Hello Everyone 🙂

 

Please could you help with the below, i am trying to add a number of month's to a date based on the months being selectable via a dropdown, its coming up with an error when i use the below. Any help is much appreciated.

 

Formula:
DateAdd(StartDate_dtp.SelectedDate, Value(ContractLength_drp.SelectedText), TimeUnit.Months)

 

Error:
Expected text or a number. Edit your formula so that it evaluates to text or a number.

 

Appy1_0-1691484691826.png


Thanks

Chris

I have the same question (0)
  • Verified answer
    v-hanytian-msft Profile Picture
    Microsoft Employee on at
    Re: Formula help - DateAdd

    Hi @Appy1 ,

     

    May I ask waht items of the ContractLength_drp?

     

    We made asample for you.

    vhanytianmsft_0-1691485074609.png

     

     Please try this:

    DateAdd(StartDate_dtp.SelectedDate, Value(ContractLength_drp.Selected.Value), TimeUnit.Months)

    vhanytianmsft_1-1691485089866.png

     

    Hope this will help you,

    Best Regards,
    Tina

  • CC-19121430-0 Profile Picture
    240 on at
    Re: Formula help - DateAdd

    Hello Tina,

     

    The items of my ContractLength_drp is the below:
    SortByColumns(Distinct(Tbl_Funding, Duration),"Value")

     

    What you suggested has worked perfectly though so i thank you very much for your help 🙂

     

    Kind Regards

    Chris

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 652 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 410 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 236

Last 30 days Overall leaderboard