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 / Select a range of date...
Power Apps
Answered

Select a range of dates in date picker

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm trying to sort my data in a range of dates in the date picker. For example being able to select 7/4/21 and select 7/26/21 and get any data that was entered in that time period. And/or being able to have a clickable options like "Last Week" "Last month" "Last 3 months"

 

I'm a beginner so please explain it in detail 🙂

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

    Hi @Anonymous ,

     

    I did a simple demo for you.

    1\ This is my datasource.

    vxiaochenmsft_0-1627610212668.png

     

    2\ Add 2 datepicker control 'DatePicker1' and 'DatePicker2'.

    Add a gallery control and set its Items property to:

    Filter(LIST148,Date_Column>=DatePicker1.SelectedDate&&Date_Column<=DatePicker2.SelectedDate)

    vxiaochenmsft_1-1627610369952.png

     

    3\ Add a button control and set its onselect property to:

    Set(Last_Week_End,DateAdd(Today(),-Weekday(Today()),Days));Set(Last_Week_Start,DateAdd(Today(),-Weekday(Today())-6,Days))

    //Create 2 variables

     

    Set gallery's Items property to:

    Filter(LIST148,Date_Column>=Last_Week_Start&&Date_Column<=Last_Week_End)

    // Show last week 

    vxiaochenmsft_2-1627610869604.png

     

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    With(
     {
     sData: Filter(
     'SPDataSource',
     IsBlank(FromDate.SelectedDate) || IsEmpty(FromDate.SelectedDate) || Date >= FromDate.SelectedDate,
    	 IsBlank(ToDate.SelectedDate) || IsEmpty(ToDate.SelectedDate) || Date <= ToDate.SelectedDate
     )
     }, 
    	Sort(
    		sData, Date, If(SortDesending1, Descending, Ascending)
    	) 
    
    )

     

    We can add more filters if you need them.

     

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

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
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard