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 / Dropdown to force date...
Power Apps
Answered

Dropdown to force date picker range selectiom

(0) ShareShare
ReportReport
Posted on by 75

It's possible to have a dropdown with year and month and force the datepicker range?

 

example: 

 

a10703ant_0-1643204008440.png

 

ex: If i select Month January and year 2021 the filter datepicker range its 1/1/2021 to 31/01/2021

 

it's possible to force ?

 

 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @a10703ant 

    Yes, you just need to have the DefaultDate property of the date picker be the value you want.

     

    Ex.  DatePicker1 DefaultDate property formula:

        Date(yourYearDropDown.Selected.Value, yourMonthDropDown.Selected.Value, 1)

     

    Your DatePicker2 DefaultDate property formula:

        DateAdd(DateAdd(Date(yourYearDropDown.Selected.Value, yourMonthDropDown.Selected.Value, 1), 1, Months), -1, Days)

     

    I hope this is helpful for you.

  • a10703ant Profile Picture
    75 on at

    What means the function for i understand the syntax?

     

    yourMonthDropDown.Selected.Value, 1) why 1?

     

     yourMonthDropDown.Selected.Value, 1), 1, Months), -1, Days) and why 1 Months and -1 days?

     

    thanks

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @a10703ant 

    The Date function expects three parameters, the year, the month and the day.  So, the formula:

       Date(yourYearDropDown.Selected.Value, yourMonthDropDown.Selected.Value, 1)

    will produce a date that is the first day of the selected year and month.

     

    For the second datepicker, you wanted the last day of the month.  So, the trick is to add 1 month to the first day of the month and then subtract 1 day.  That will be the last day of that month.

    DateAdd(DateAdd(Date(yourYearDropDown.Selected.Value, yourMonthDropDown.Selected.Value, 1), 1, Months), -1, Days)

    So in the above formula, we again get the Year, Month and Day 1 date, and then add 1 month to it and subtract 1 day from it.  That's the last day.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard