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 / get date increase 2 mo...
Power Apps
Unanswered

get date increase 2 months till end date in power app

(0) ShareShare
ReportReport
Posted on by 42

Hi,
I have two date pickers: start date and end date. And I want to get dates every 2 months until the end date.
eg: Start Date is 25/07/2023 and end date 31/1/2024
So want to result is 
25/09/2023
25/11/2023

25/01/2024
How to calculate this.
Notes: every 2 months will change later. This gets from the text box


Thanks,

Categories:
I have the same question (0)
  • EddieE Profile Picture
    4,650 Moderator on at

    @hninyuaung 

    I placed this code inside a gallery, but you can use it in a collection as well if you want?

    ForAll(
     Sequence(
     DateDiff(dpStart.SelectedDate, dpEnd.SelectedDate, TimeUnit.Months) / Value(mthInput.Text)),
     {
     Date: DateAdd(dpStart.SelectedDate,Value * Value(mthInput.Text), TimeUnit.Months)
     }
    )

     

    My on screen setup, and resulting output

    EddieE_0-1690258588673.png

    Note: this code will only work for units in Months. If you need other units, eg Days, Weeks, Years then you will need to play around with the code where you see TimeUnit.Months

     

  • hninyuaung Profile Picture
    42 on at

    Hello ,
    Thanks for your solution.

  • hninyuaung Profile Picture
    42 on at

    Hello, 
    I would like to get the second Week of Monday every 2 months Intervals. It also has Start Date and End date. How to do this.
    Thanks

  • EddieE Profile Picture
    4,650 Moderator on at

    @hninyuaung 

    This is probably a second question but I'm happy to continue on here.

     

    Can you explain what you want with some data? I don't quite understand what you are looking for

  • hninyuaung Profile Picture
    42 on at

    I would like to get the second Week of Monday every 2 months Interval. It also has Start Date and End date. 

    hninyuaung_0-1690336176112.png

    The First dropdown is week -> first week, second week,...
    The Second Dropdown is -> Sunday, Monday,...
    The third text box is-> month interval -> 2 months or 3 months or 1 month,.....
    My question -> I would like to get dates if I choose these data. 
    thanks,

     

  • EddieE Profile Picture
    4,650 Moderator on at

    @hninyuaung 

    I still must be missing something, can you share actual output from a problem that you would use in real life.

     

    I can see the dropdowns but don't understand what the expected output is.

  • hninyuaung Profile Picture
    42 on at

    Hello ,
    I booked the second week of  Monday in every 2 months
    This is Start Date 10/08/2023 to End Date 31/12/2023
    The output is 

    14/08/2023
    09/10/2023
    11/12/2023
    How to solve this. We can choose these dropdown data and will get output based on these dropdown data that I  choice.
    Thanks

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

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard