Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Dropdown Contains Dates in Two Week Groups

(0) ShareShare
ReportReport
Posted on by 4,704 Super User 2025 Season 1

I need a Dropdown that allows the user to choose a date range that includes two weeks at a time.

When the user opens the Dropdown they should be able to choose from a list of date (in two week blocks), with the defaul date being including current date, however that range shoud start at the Sunday before.

The should be able to go as far back a one month and as far into the feature as the system allows.

Phineas_1-1659585358625.png

 

 

Categories:
  • rb Profile Picture
    833 Super User 2024 Season 1 on at
    Re: Dropdown Contains Dates in Two Week Groups

    Hey @Phineas,

     

    If you are generating this dynamically in PowerApps, it will be different every time you load it - is that OK?

     

    Here is an example of how I implemented with a combo box (so I could show the period number and the date range at the same time):

    metsshan_0-1659589525986.png

     

    With(
     //Get Sunday before-last as Seed Day
     {SeedDate: DateAdd(Today(), -Weekday(Today(), Monday) - 7, Days)},
     ForAll(
     //Generate a list of 2-week period starting from 2 periods before Seed Date
     Sequence(10, -2, 1) As Offset,
     {
     Number: Text(Offset.Value + 3),
     Dates: Text(DateAdd(SeedDate, Offset.Value * 14, Days), "dd/mm/yyyy") & " - " & Text(DateAdd(SeedDate, (Offset.Value + 1) * 14 - 1, Days), "dd/mm/yyyy")
     }
     )
    )

     

     

    The first argument of Sequence(), which is 10 in my example, can be adjusted to determine the number of periods generated.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard