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 Apps
Answered

Modify my filter

(0) ShareShare
ReportReport
Posted on by 521

Hello,
I need to modify my currant Filter code I have 5 buttons  ALL - OPEN- PAST DUE - DUE TODAY - CLOSED  which I filter on the gallery and wanted to add the highlighted on red in to the filter? so example when I click past due should show me the anything past or due today for now?
My SharePoint list I have Due Date field which is date type

Filter(
 TaskSPList,
 StatusText = gblFilterRepairOrders Or gblFilterRepairOrders = "All" 
 
)

Thanks.

Categories:
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @PowerApps11 you can extend the filter with the date fields:

    Filter(
     TaskSPList,
     gblFilterRepairOrders = "All" || StatusText = gblFilterRepairOrders || (gblFilterRepairOrders = "PAST DUE" && DATEFIELD < Today()) || (gblFilterRepairOrders = "DUE TODAY" && DATEFIELD = Today())
    )

    (you would also need to set the variable to the filter text on the new buttons)

     

    What could be a possible improvement is using 2 dropdowns instead of 5 buttons. This would remove the need to set a variable on the OnSelect of the buttons and probably save you some screen space. One dropdown would be for status (ALL - OPEN - CLOSED) the other one for date filtering (PAST DUE - DUE TODAY).

     

    If this solves your question, would you be so kind as to accept it as a solution.
    Thanks!

  • PowerApps11 Profile Picture
    521 on at

    Hi @LaurensM 
    Thanks for the help this worked for me,

    if I add two dropdown and you said one for the status and other one for past and due today, how can I filter that and what should I use the second dropdown formula past due / today?
    Thanks 

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    @PowerApps11, glad I could help.

     

    In order to use the dropdowns you will need 2 dropdowns (status & date).
    The Items property will have the following:

    //StatusDropDown
    ["ALL", "OPEN", "CLOSED"]
    
    //DateDropDown
    ["PAST DUE", "DUE TODAY"]

     

    The OnChange property of the DateDropDown:

    //This will reset the value of the StatusDropdown back to 'ALL'
    Reset(StatusDropDown)

    When we filter via date, we want the status dropdown to be ALL.

     

    Remove the Default property & set AllowEmptySelection to true for the DateDropDown.

     

    The gallery items property will be:

    Filter(
     TaskSPList,
     //Check if all is selected, else filter by status
     StatusDropDown.Selected.Value = "ALL" || status = StatusDropDown.Selected.Value,
     //Check if date dropdown is blank, else filter by date range
     IsBlank(DateDropDown.Selected.Value) || (DateDropDown.Selected.Value = "PAST DUE" && DATEFIELD < Today()) || (DateDropDown.Selected.Value = "DUE TODAY" && DATEFIELD = Today())
    )

     

    I hope this helps!

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

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard