cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kgordish
Resolver I
Resolver I

Gallery formula to exclude item based on a Choice Value

Hello I have a formula exclusion question. 

SharePoint is my data source.

 

Trying to exclude Rating does not equal "NR".  
Do you know how I could add to formula below?

It took me a while to learn how to finally avoid the delegation warnings.
Now, need to learn how to exclude. 

 

SortByColumns(Filter('Historical Site Data Export Nov 20', Line = LineDrop.Selected.Result && StartsWith(Region, Regiondrop.SelectedText.Value) && StartsWith(Status,StatusDrop.SelectedText.Value) && StartsWith(Program, ProgramSearchBox.Text)), "Year", Ascending, "Dates")
1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @kgordish , 

As you have mentioned the below will receive a Delegation warning as <> (does not equal) is not Delegable.

SortByColumns(
   Filter(
      'Historical Site Data Export Nov 20', 
	  Line = LineDrop.Selected.Result && 
      StartsWith(
         Region, 
         Regiondrop.Selected.Value
      ) && 
      StartsWith(
         Status,
         StatusDrop.Selected.Value
      ) && 
      StartsWith(
         Program, 
         ProgramSearchBox.Text
      ) &&
      Rating <> "NR"
   ), 
   "Year", 
   Ascending, 
   "Dates"
)

so my question is what are the other valid values for Rating? For example if they were "Excellent", "Good", "Average" and "Bad", you would do this

SortByColumns(
   Filter(
      'Historical Site Data Export Nov 20', 
	  Line = LineDrop.Selected.Result && 
      StartsWith(
         Region, 
         Regiondrop.Selected.Value
      ) && 
      StartsWith(
         Status,
         StatusDrop.Selected.Value
      ) && 
      StartsWith(
         Program, 
         ProgramSearchBox.Text
      ) &&
      (
         Rating = "Excellent" ||
         Rating = "Good" ||
         Rating = "Average" ||
         Rating = "Bad"
      )
   ), 
   "Year", 
   Ascending, 
   "Dates"
)

Also note that .SelectedText is Depricated, so you should use .Selected

 

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 @kgordish , 

As you have mentioned the below will receive a Delegation warning as <> (does not equal) is not Delegable.

SortByColumns(
   Filter(
      'Historical Site Data Export Nov 20', 
	  Line = LineDrop.Selected.Result && 
      StartsWith(
         Region, 
         Regiondrop.Selected.Value
      ) && 
      StartsWith(
         Status,
         StatusDrop.Selected.Value
      ) && 
      StartsWith(
         Program, 
         ProgramSearchBox.Text
      ) &&
      Rating <> "NR"
   ), 
   "Year", 
   Ascending, 
   "Dates"
)

so my question is what are the other valid values for Rating? For example if they were "Excellent", "Good", "Average" and "Bad", you would do this

SortByColumns(
   Filter(
      'Historical Site Data Export Nov 20', 
	  Line = LineDrop.Selected.Result && 
      StartsWith(
         Region, 
         Regiondrop.Selected.Value
      ) && 
      StartsWith(
         Status,
         StatusDrop.Selected.Value
      ) && 
      StartsWith(
         Program, 
         ProgramSearchBox.Text
      ) &&
      (
         Rating = "Excellent" ||
         Rating = "Good" ||
         Rating = "Average" ||
         Rating = "Bad"
      )
   ), 
   "Year", 
   Ascending, 
   "Dates"
)

Also note that .SelectedText is Depricated, so you should use .Selected

 

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.

@WarrenBelz 
Thanks Warren. I believe that should work. Just need to adapt formula to my rating scheme. 
It did not cross my mind to reverse the logic to achieve the same outcome. 
Really appreciate the community and your assistance. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,389)