cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vffdd
Post Prodigy
Post Prodigy

apologies another FirstN query !

So I had a couple of FirstN queries earlier that were solved very quickly and I have one more !

 

I am trying to do a FirstN on a filtered list but instead it is FIltering the FIrstN list !     I've played around with it so again think I'm close but just not there.

 

Here's what I have

 

Filter(FirstN(Sort(MainList, QueriedAmount, Descending),Value (TopNumber.Text)),QueryStatus<>"Closed",QueryStatus<>"Resolved")

 

So that actually works except it Filters the FirstN instead of the list.. which makes sense because Filter is listed first.  So in otherwords it takes the Top 10 and then it filters that to give me the ones that aren't closed or resolved.  I want it to filter the main list for those that aren't closed or resolved and then do the FirstN on those !

 

I've tried moving where the Filter command is but just can't get it right !

 

Do I need to do the filter first put the result of that into a collection somewhere and then do the FirstN on that? or is there an easier way to do it?

 

TIA

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @vffdd ,

I would go this way

FirstN(
   Sort(
      Filter(
         MainList, 
         QueryStatus<>"Closed" && QueryStatus<>"Resolved"   
      ),
      QueriedAmount, 
      Descending
   ), 
   Value(TopNumber.Text)
)

 

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

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @vffdd ,

I would go this way

FirstN(
   Sort(
      Filter(
         MainList, 
         QueryStatus<>"Closed" && QueryStatus<>"Resolved"   
      ),
      QueriedAmount, 
      Descending
   ), 
   Value(TopNumber.Text)
)

 

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.

Super thanks @WarrenBelz  I  knew I was close just couldn't quite get it !! 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,192)