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 / Start date and end dat...
Power Apps
Answered

Start date and end date dynamic

(0) ShareShare
ReportReport
Posted on by 77

Hello everyone, I need some help from you

I’m trying to take the overall start date, input that into the start date of the first line and then add the number of days to get the end date and then use this end date as the start date for the next line and so on, 

FB_IMG_1588816581383.jpg

 

Post data: I have the repeating table working fine so far what I need is update Start date and end date on the lines as described above. I need to have this done in PowerApps, This Picture is only to be illustrated by it 

 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Do you want to do this in Excel or Powerapps?

    If in Powerapps, is it on a form

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • Ramonjairo31 Profile Picture
    77 on at

    PowerApps 

  • eka24 Profile Picture
    20,925 on at

    Assuming you have only one line (One record ) and you want a second line or row:
    Insert a TextBox1 and in the Default put:
    LookUp(Table1,Decription=TextBox1.Text,EndDate) ...This will pull the old end date

     

    If you have a TextBox2 which will record EndDate for next line/record put:

    DateAdd(DateValue(TextInput5_3.Text),5)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Ramonjairo31 Profile Picture
    77 on at

    Actually I need more than two lines, because this is repeating table, I have the repeating tablet working so far, 3A90FEBD-2074-4E56-9B25-2423C8A0EC61.jpeg

     

  • eka24 Profile Picture
    20,925 on at

    It's important you provide all information you have to enable people give the needed help when you ask the question.

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramonjairo31 ,

    Do you want to create a screen like the screenshoot that you provided?

    Do you want the startdate will be the last enddate automatically, the end date will be the startdate+days?

    If so, I've made a similar test for your reference:
    1)my data source:

    listname: user_form1

    fieldname: start date(date type), end date(date type), days( number type), task(text type)

    2)my app:
    insert these controls: 2 textinputs, 2 datepickers, a submit button, a data table

    set datepicker1's DefaultDate:

    If(IsEmpty(user_form1),Today(),Last(user_form1).enddate)

    set datepicker2's DefaultDate:

    DateAdd(DatePicker1.SelectedDate,Value(TextInput2.Text))

    set datepicker2's DisplayMode:

    Disabled

    set submit button's OnSelect:

    Patch(user_form1,Defaults(user_form1),{task:TextInput1.Text,days:Value(TextInput2.Text),'start date':DatePicker1.SelectedDate,'end date':DatePicker2.SelectedDate});Reset(TextInput1);Reset(TextInput2)

    set the datatable's Items:

    user_form1

    58.PNG

     

     

    Then the screen will just like what you description.

    Do not forget to replace the fieldnames, listnames,control names with yours.

     

     

    Best regards,

  • Ramonjairo31 Profile Picture
    77 on at

    Thanks for the replied it,  this is working fine, however, there is a new request on this point which it's there is exist the possibility that task number 1 will be put down as task number 3 and now the amount of day is different so, need to recalculate all of this again

    Test.png
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Ramonjairo31 ,

    Yes, since every record's start date and end date has relationship, so if you modify one record, you also need to modify other records.

    For example:

    if you make task1 to task3's original time, you need these formulas:

    Patch(user_form1,LookUp(user_form1,task="task2"),
    {'start date':LookUp(user_form1,task="task1",'start date'),//task1's start time
    'end date':DateAdd(LookUp(user_form1,task="task1",'start date'),LookUp(user_form1,task="task2",days)) //task1's start time+days
    });
    Patch(user_form1,LookUp(user_form1,task="task1"),
    {'start date':DateAdd(LookUp(user_form1,task="task3",'end date'),-LookUp(user_form1,task="task1",days)),//task3's end time+days
    'end date':LookUp(user_form1,task="task3",'end date')});//task3's end time
    Patch(user_form1,LookUp(user_form1,task="task3"),
    {'start date':LookUp(user_form1,task="task2",'end date'),//task2's end time
    'end date':LookUp(user_form1,task="task1",'start date'//task1's start time
    }
    )
    
    //the order will become task2->task3->task1

     

     

     

    Best regards,

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
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard