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 by multiple lis...
Power Apps
Answered

filter by multiple list items and by month

(0) ShareShare
ReportReport
Posted on by 134

Im hoping this is possible. 

I currently have a gallery that's items is the following:

SortByColumns(Filter('Contraband Log (CL)','Facility Location'.Value=Dropdown5_7.Selected.Value),"CLDateofContrabandDiscovery",SortOrder.Descending)

 

and the items within the list have MANY dates. i want to be able to filter by the Facility location like it already is, but also say that i only want to see the MONTH of the CLDateofContrabandDiscovery (which is a date picker). i have a dropdown to select the month (CS_Month_7) and i would like the filter to update based on that. i still need it sorted in descending order WITHIN the selected month

Snag_4408988f.png

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    Hi @BHaapi ,

    If I have interpreted your post correctly, you will also need the Year (I have guessed the control name so you may have to change it). I have also used the structure shown for Delegation reasons

    With(
     {
     wData:
     SortByColumns(
     Filter(
     'Contraband Log (CL)',
     'Facility Location'.Value = Dropdown5_7.Selected.Value
     ),
     "CLDateofContrabandDiscovery",
     SortOrder.Descending
     ),
     wMonthYear: CS_Month_7.Selected.Value & CS_Year_7.Selected.Value
     },
     Filter(
     wData,
     Text(CLDateofContrabandDiscovery,"mmmmyyyy") = wMonthYear
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • BHaapi Profile Picture
    134 on at

    Snag_483989e6.png

    So the year was originally a text field, but i had no problem updating it because i seen that the code was specifically looking for it. its not connecting to the datasource now though. Sorry i tried to troubleshoot a bit but this is my first use of the With code. im wondering if its something with the filter portion, as that is the only area that the formula isnt connecting properly.

     

    Also, thank you so much. im going to continue looking at the With formula. this is my more advanced page, but it looks like something i should definitely be learning!

  • Verified answer
    WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    @BHaapi ,

    Leave the year out for now and see if this is valid code

    With(
     {
     wData:
     SortByColumns(
     Filter(
     'Contraband Log (CL)',
     'Facility Location'.Value = Dropdown5_7.Selected.Value
     ),
     "CLDateofContrabandDiscovery",
     SortOrder.Descending
     )
     },
     Filter(
     wData,
     Text(CLDateofContrabandDiscovery,"mmmm") = CS_Month_7.Selected.Value
     )
    )

     

  • BHaapi Profile Picture
    134 on at

    negative, here is the details:

    Snag_485d11d8.png

  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    Hi @BHaapi ,

    Please check your values and this code again- I just ran it here on a test list and received no errors and the expected result

    WarrenBelz_0-1685651508559.png

     

  • BHaapi Profile Picture
    134 on at

    So the With function wouldn't seem to work at all, but I was able to sort the list on Sharepoint and activate the same concept with 

    Items: Filter('Contraband Log (CL)','Facility Location'.Value=Dropdown5_7.Selected.Value && Text('Date of Contraband Discovery', "mmmm")= CS_Month_7.Selected.Value)

     

    Thank you so much for your help!

  • Verified answer
    WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    Hi @BHaapi ,

    I can assure you the With() function will work and was included to deal with a Delegation issue on the second filter

    With(
     {
     wData:
     Filter(
     'Contraband Log (CL)',
     'Facility Location'.Value=Dropdown5_7.Selected.Value
     )
     },
     Filter(
     wData, 
     Text('Date of Contraband Discovery', "mmmm") = CS_Month_7.Selected.Value
     )
    )

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard