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 / Filter gallery by titl...
Power Apps
Answered

Filter gallery by title and only show items from today onwards

(0) ShareShare
ReportReport
Posted on by 46

I have an app which i am displaying data from sharepoint list and it is filtering it by name

SortByColumns(Filter([@'datasource'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

i also want only items from today onwards  and for a 14 day period in front to display so if i open the app today 27/6 i want to see any courses that start in 14 days or further only (so anything 12 july onwards). 

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    SortByColumns(Filter([@'datasource'], StartsWith(Title, TextSearchBox1.Text),CourseDate >= Today() && CourseDate <= DateAdd(CourseDate,14,Days), "Title", If(SortDescending1, Descending, Ascending))

     

    There may be some syntax issues but the structure will stay the same. You can add as many filter conditions as you want after adding a comma. DateAdd function will take 3 parameters 1. Date, 2. Number of Units, 3. Unit. 

    So as per the code, it will display data that has a course date greater than or equal to today and less than or equal to Today + 14 days.

  • theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    Hello,
    You can use below formula:

    For Today Onwards:
    
    SortByColumns(Filter([@'datasource'], yourDate>DateAdd(Today(),-1,Days), //Today=Greater than yesterday
    StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
    
    For 14 days onwards:
    SortByColumns(Filter([@'datasource'], yourDate>DateAdd(Today(),13,Days), //Today=Greater than yesterday
    StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

    I prefer using > instead of = as this will avoid timestamp issues

  • sailormoon218 Profile Picture
    46 on at

    Hi guys i tried that and it is not displaying anything.

     

    SortByColumns(Filter(AddColumns([@'22/23 Southern Zone Training Courses'], "CourseName", Courses.Value), StartsWith(CourseName, TextSearchBox1.Text)), "CourseName", If(SortDescending1, Descending, Ascending)) is what I have so far

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

    Hello @sailormoon218 , what is the error you get when you implement Date filter?
    Please verify that you date column Startdate is of type Date.
    if they are date columns then only date filters can be applied with these Formulas

    For Today Onwards:
    
    SortByColumns(Filter([@'datasource'], yourDate>DateAdd(Today(),-1,Days), //Today=Greater than yesterday
    StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
    
    For 14 days onwards:
    SortByColumns(Filter([@'datasource'], yourDate>DateAdd(Today(),13,Days), //Today=Greater than yesterday
    StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard