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 / Reset filter by date
Power Apps
Answered

Reset filter by date

(0) ShareShare
ReportReport
Posted on by 356

Ok, easy one, but it has me stumped as a novice. I have a gallery that is filtered by a datepicker.  On first entry it displays all dates. When I click on date it works fine and filters selected date, But how do I get it to display all the dates again?

Thx for your consideration.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    HI @slhangen ,

    Are you wanting all the information back when the date picker is cleared?

    Try this (replace with your names)

    If(
     Value(YourDatePickerName.SelecedDate)=0,
     YourListName,
     Filter(
     YourListName,
     DateDiff(
     YourDateField,
     YourDatePickerName.SelectedDate,
     Days
     )=0
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • slhangen Profile Picture
    356 on at

    Still getting errors in DateDiff argument: Invalid argument type (Table), expecting DATE.TIME value instead

    If(
    Value(dpSelContactDate_4.SelectedDate)=0,
    'AT HOME LEARNING STUDENT CONTACT LOG',
    Filter(
    'AT HOME LEARNING STUDENT CONTACT LOG',
    DateDiff(
    LogContactDate,
    'AT HOME LEARNING STUDENT CONTACT LOG',
    Days
    )=0
    )
    )

     

    Sharepoint List is          'AT HOME LEARNING STUDENT CONTACT LOG'

    Sharepoint column is    Sharepoint is LogContactDate

    Datepicker control is     dpSelContactDate_4

     

    Thx for your assistance

  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    Thanks @slhangen ,

    You have to compare the date field with the date picker selected date - you are comparing it with the list.

     

    If(
     Value(dpSelContactDate_4.SelectedDate)=0,
     'AT HOME LEARNING STUDENT CONTACT LOG',
     Filter(
     'AT HOME LEARNING STUDENT CONTACT LOG',
     DateDiff(
     LogContactDate,
     dpSelContactDate_4.SelectedDate,
     Days
     )=0
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • slhangen Profile Picture
    356 on at

    Thx WarrenBelz,

     

    That worked great.  When I click the refresh button I get all the dates back. 

     

    A couple final things though, with this sophisticated IF statement, I am perplexed on how to write the sortbycolumns and a filter user statement. Just not can't figure out where they go.

     

    The gallery needs to be filtered by current user:

    Filter('AT HOME LEARNING STUDENT CONTACT LOG',LogContactPerson=varUserName) and

    sorted with ThisItem.LogContactDate descending, then ThisItem.LogStudentName in ascending order.

     

    Sorry for this but I thought once I got the date picker to work I could write in the other arguments but I am getting all kinds of errors with my syntax around your IF statement. 

     

    Thx again for your prompt and easy to follow support!  I have been working on this gallery for weeks:{  Much appreciated.

     
  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    Thanks @slhangen ,

    I will give you a Sort statement

    Sort(
     Sort(
     Filter(
     'AT HOME LEARNING STUDENT CONTACT LOG',
     LogContactPerson=varUserName
     ),
     LogStudentName,
     Ascending
     ),
     LogContactDate,
     Descending, 
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • slhangen Profile Picture
    356 on at

    Thank you, I was able to get that but I don't know how to wrap it around the other IF statement:

     

    If(
     Value(dpSelContactDate_4.SelectedDate)=0,
     'AT HOME LEARNING STUDENT CONTACT LOG',
     Filter(
     'AT HOME LEARNING STUDENT CONTACT LOG',
     DateDiff(
     LogContactDate,
     dpSelContactDate_4.SelectedDate,
     Days
     )=0
     )
    )

     Very complicated

  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    @slhangen ,

    Yes challenging - if the below does not work (free-typed so watch commas and brackets), it is going to get very complex

    Sort(
     Sort(
     If(
     Value(dpSelContactDate_4.SelectedDate)=0,
     'AT HOME LEARNING STUDENT CONTACT LOG',
     Filter(
     'AT HOME LEARNING STUDENT CONTACT LOG',
     LogContactPerson=varUserName &&
     DateDiff(
     LogContactDate,
     dpSelContactDate_4.SelectedDate,
     Days
     )=0
     )
     ),
     LogStudentName,
     Ascending
     ),
     LogContactDate,
     Descending, 
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • slhangen Profile Picture
    356 on at

    You are amazing! Small thing (but I can live with it, if necessary):

    The gallery works perfect when date is selected. 

     

    However, on this screen I only want to show the user's contacts.  With your syntax, this is working but it shows all contact people when screen opens or when calendar value is cleared. I think its because the user filter is nested within the IF statement.

     

    Tried to run Filter('AT HOME LEARNING STUDENT CONTACT LOG', LogContactPerson=varUserName) on screen's On Visible property but I still get all users.

     

    FACESLAP!

     

    Thx so much for your patience!

  • Verified answer
    WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    Hi @slhangen ,

    I actually spotted that afterwards and wondered if you needed that - try

    Sort(
     Sort(
     If(
     Value(dpSelContactDate_4.SelectedDate)=0,
     Filter(
     'AT HOME LEARNING STUDENT CONTACT LOG',
     LogContactPerson=varUserName
     ),
     Filter(
     'AT HOME LEARNING STUDENT CONTACT LOG',
     LogContactPerson=varUserName &&
     DateDiff(
     LogContactDate,
     dpSelContactDate_4.SelectedDate,
     Days
     )=0
     )
     ),
     LogStudentName,
     Ascending
     ),
     LogContactDate,
     Descending, 
    )
  • slhangen Profile Picture
    356 on at

    AMAZING stuff, Warren!  Thanks for your patience.  The PowerApps syntax is a little glitch for me and has me tearing my hair out sometimes.  What an amazing asset this forum is for beginners.  Certainly helps those who may have given up on the this platform (like me).

     

    Thx again!

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