cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vffdd
Responsive Resident
Responsive Resident

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 III
Super User III

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 III
Super User III

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

vffdd
Responsive Resident
Responsive Resident

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

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 (889)