web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter gallery with Da...
Power Apps
Answered

Filter gallery with Date range, people field and lookup field

(0) ShareShare
ReportReport
Posted on by 19

Hi all, i might be making no sense here. But here is what i am trying to do from data source as sharepoint list. I have list called (Issues) with below fields (ones needed for the purpose only)

 

StaffName (people field)

IssueDate(Date field)

KPI (Lookup field of another list)

 

I have a screen and placed a gallary2 with this data source. I placed a combobox4 with items property (Choices([@Issues].StaffName) and another Dropdown3 with items property (Choices([@Issues].KPI) and two Datepickers (Datepicker1 and Datepicker2).

 

I would like to filter the Gallary2 based on date range (issueDate) with Datepicker1 and Datepicker2, combobox4 selected employee name (StaffName) and Drobdown3 (KPI lookup). So far i am able to filter using combobox4 with below filter on Gallary2 but i dont have any idea how to mix all these filtering at for same gallary! I am just a beginner and any heads up for this would be much appreciate. Thanks.

 

Sort(If(CountRows(ComboBox4.SelectedItems)<1,Issues,Filter(Issues,StaffName.DisplayName = ComboBox4.Selected.DisplayName)), IssueDate, Descending)

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @Fred1411 

    Here's an example of how to combine the DatePickers and the Combobox in a single FILTER statement.  Use this code inside the Items property of the gallery to filter it.  No information was given about Dropdown3 so I did not include it.

    Filter(
     your_datasource_name,
     DatePicker1.SelectedDate = Blank() Or DatePicker1.SelecteDate <= YourDateColumn
     And DatePicker2.SelectedDate = Blank() Or DatePicker2.SelecteDate >= YourDateColumn
     And ComboBox4.Selected = Blank() Or ComboBox4.Selected.DisplayName = StaffName.DisplayName
    )

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Fred1411 Profile Picture
    19 on at

    Hi there, Dropdown3 is based on lookup column of Sharepoint list. The field name is "KPI" and on screen i have this Dropdown3 with items property (Choices([@Issues].KPI) this is value/Id type as originally it is from another list in my Sharepoint. I hope i made it clear.

     

    Btw, thank you very much for your time and i will try with your solution for now without Dropdown3.

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @Fred1411 

     

    Can you try to use the expression below?

    Sort(Filter(Issues, If(IsEmpty(Combobox4.SelectedItems),true, StaffName.DisplayName = ComboBox4.Selected.DisplayName), If(IsBlank(DatePicker.SelectedDate) || IsBlank(DatePicker2.SelectedDate),true, IssueDate >= DatePicker1.Selected Date && IssueDate <= DatePicker2.SelectedDate), If(IsBlank(Dropdown3.Selected.Value),true, KPI.Value = Dropdown3.Selected.Value)), IssueDate, Descending)

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard