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 / Default Selected Items...
Power Apps
Unanswered

Default Selected Items property according to the week of the month

(0) ShareShare
ReportReport
Posted on by 361

Hi guys,

the idea is simple, I have a combo with 4 options, and these options are Week 1, Week 2, Week 3, Week 4.

I need to make the default items of this combo already selected
"Week1" if it is the first week of the month;
"Week2" if it is the second week of the month;
"Week3" if it is the third week of the month;
"Week4" if it is the fourth week of the month;

 

and when you turn the month back to one, making a cycle. Thanks!

Joaoandrebs_0-1688489985360.png

Semana1=Week1

Categories:
I have the same question (0)
  • madlad Profile Picture
    2,637 Moderator on at

    This equation will always return the week which you are currently in of the current month, in the form of "Week#". Put it in the DefaultSelectedItems field on your combobox.

     

    It takes todays date, finds the difference between itself and the fist day of the month, divides by 7, and rounds up to find the week count. It will also add an additional week if there is the trailing end of a week at the start of the month(i.e if the first day is a thursday, it will account for this shorter week by adding an extra one to the count)

     

     

    [
     "Week" & RoundUp(
     DateDiff(
     Date(
     Year(Today()),
     Month(Today()),
     1
     ),
     Today()
     ) / 7,
     0
     ) + If(
     Lower(
     Text(
     Date(
     Year(Today()),
     Month(Today()),
     1
     ),
     "ddd"
     )
     ) = "sun",
     0,
     1
     )
    ]

     

     

    However, this equation can produce up to 6 weeks in a month, since it considers leading or trailing part-weeks as weeks, and it looks like you have only 4 weeks as current options?
    Something will have to be modified to account for this, either to this equation, or you'll have to make this combobox have more weeks. If necessary, an equation modification should be relatively simple, depending on your specific requirements.

     

    Hope this helps!

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

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard