cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aaw
New Member

Filter multiple fields

Hello

 

I have a powerapp that I am trying to get to display items that are assigned to a specific coordinator. I have managed to get that portion to work but I also am looking for the results to only display the items that have a empty completion date. I get no results to display with the code below. 

 

SortByColumns(Filter([@'Tracking Database'], Coordinator.DisplayName ="Doe, John" && IsBlank('Completion Date')), "Title", If(SortDescending1, Descending, Ascending))

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

@aaw ,

The filter is not Delegable (so will only return results on the first 500-2,000 records depending on your limit), however it is valid for an empty date. You could try this

With(
   {
      wList:
      Filter(
         [@'Tracking Database'], 
         Coordinator.DisplayName ="Doe, John"
      )
   },
   SortByColumns(
      Filter(
         wList, 
         Value('Completion Date')=0
      ), 
      "Title", 
      If(
         SortDescending1, 
         Descending, 
         Ascending
      )
   )
)

 

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.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User III
Super User III

Hi @aaw ,

Try this

SortByColumns(
   Filter(
      [@'Tracking Database'], 
      Coordinator.DisplayName ="Doe, John" && 
      Value('Completion Date')=0
   ), 
   "Title", 
   If(
      SortDescending1, 
      Descending, 
      Ascending
   )
)

 

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.

I had tried that code once before but also gives no results. There are entries with no completion date that should be showing.

 

@aaw ,

The filter is not Delegable (so will only return results on the first 500-2,000 records depending on your limit), however it is valid for an empty date. You could try this

With(
   {
      wList:
      Filter(
         [@'Tracking Database'], 
         Coordinator.DisplayName ="Doe, John"
      )
   },
   SortByColumns(
      Filter(
         wList, 
         Value('Completion Date')=0
      ), 
      "Title", 
      If(
         SortDescending1, 
         Descending, 
         Ascending
      )
   )
)

 

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.

View solution in original post

Yes that one worked perfectly. I am new to this, can you help me understand how the two codes you provided differ? and why one worked while the other didnt?

@aaw ,

Firstly, please read this blog of mine on Delegation then this one on the With() statement I have used in the code.

I suspect that you have more than 500 items in your list and the original statement was not Delegable looking for the blank date, therefore it only searched the first 500 records. I have done a "pre-filter" on the co-ordinator and providing this returns less than 500 records (you can increase this to 2,000), the date filter then works on that.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,127)