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 / How to get all Mondays...
Power Apps
Unanswered

How to get all Mondays day between two dates?

(0) ShareShare
ReportReport
Posted on by

Hi Folks,

 

I'm trying to create a collection which has all Mondays date in the current financial year. (April 1 2023, to March 31 2024). I found the below code which returns all Mondays in a calendar year:

 

ClearCollect(weeksList,
 ForAll(Sequence(52,-26,1) As DD,
 Text(DateAdd(DateAdd(Today(),-Weekday(Today(),Monday)+1),7 * DD.Value ,Days),DateTimeFormat.ShortDate)
 )
);

 

Can some one help me to modify this code such that it will return all Mondays between two dates?

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @rbn_nue ,

     

    Please try:

    Filter(
    With(
     {
     StartDate:DateValue("April 1 2023"),
     EndDate:DateValue("March 31 2024")
     },
     ForAll(
     Sequence(DateDiff(StartDate,EndDate),1,1),
     If(
     Weekday(DateAdd(StartDate,Value,TimeUnit.Days))=2,
     {Value:DateAdd(StartDate,Value,TimeUnit.Days)}
     )
     )
    ),!IsBlank(Value))

     

    Best Regards,

    Bof

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard