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 / Manipulate Date Picker...
Power Apps
Answered

Manipulate Date Picker depending on Dropdown values

(0) ShareShare
ReportReport
Posted on by 47

Hiya,

 

I was hoping someone could point me in the right direction. 

I have a dropdown with choices of the weeks. "Week 1", "Week 2", "Week 3" and so on.

I have a date picker that I would like to populate with the Monday of the week selected. 

The only way I have worked out how to do this is an If statement on the date picker:

 

If(
    DataCardValue20.Selected.Value = "Week 1", Date(2024, 1, 1),
    DataCardValue20.Selected.Value = "Week 2", Date(2024, 1, 8),
    DataCardValue20.Selected.Value = "Week 3", Date(2024, 1, 15),
    DataCardValue20.Selected.Value = "Week 4", Date(2024, 1, 22),
    DataCardValue20.Selected.Value = "Week 5", Date(2024, 1, 29),
)
 
This isn't working. Why isn't this working?
Also, Is there an easier way to do this?
Categories:
I have the same question (0)
  • Verified answer
    AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @MJS1987 

     

    I would use a Switch function. It would be something like this on the DefaultDate property of the DatePicker control:

     

    Switch(DataCardValue20.Selected.Value, 
     "Week 1", Date(2024, 1, 1),
     "Week 2", Date(2024, 1, 8),
     "Week 3", Date(2024, 1, 15),
     "Week 4", Date(2024, 1, 22),
     "Week 5", Date(2024, 1, 29)
    )

     

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • MJS1987 Profile Picture
    47 on at

    Bish Bash Bosh. Many Thanks. 🙂

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    @MJS1987 

     

    You're welcome! 

     

    P.s Your initial if statement would have worked if you removed the last comma before the closing bracket.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard