cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zarriq_othman
Regular Visitor

try to apply the if statement in filter function but the result still not working

Hi Power Community,

 

I'm trying to achieve the filtration of dropdown, but when I tried to create the formula the result shown in the gallery was empty. 

Below I attach the formula :

 

Filter(
'TX Master List',
Criticallity = Dropdown1_17.Selected.Value && If(
Dropdown1_15.Selected.Value = "Plant 1 (Area 1 & 4)",
AREA = 1 || AREA = 4,
Dropdown1_15.Selected.Value = "Plant 2 (Area 2 & 3)",
AREA = 2 || AREA = 3,
Dropdown1_15.Selected.Value = "Plant 3 (Area 5,6 & 7)",
AREA = 5 || AREA = 6 || AREA = 7,
Dropdown1_15.Selected.Value = "Non Regulated Area (Area 8)",
AREA = 8
)
)

 

I already tried this solution (https://powerusers.microsoft.com/t5/Building-Power-Apps/Delegation-Warning-with-IF-statement-in-Filt...) but the result was still the same. Need help with this.

 

Thank you.

4 REPLIES 4
CNT
Super User
Super User

@zarriq_othman 

Please try the following,

Filter(
	'TX Master List',
	Criticallity.Value = Dropdown1_17.Selected.Value &&
	Switch(Dropdown1_15.Selected.Value,
		"Plant 1 (Area 1 & 4)",	AREA = 1 || AREA = 4,
		"Plant 2 (Area 2 & 3)", AREA = 2 || AREA = 3,
		"Plant 3 (Area 5,6 & 7)", AREA = 5 || AREA = 6 || AREA = 7,
		"Non Regulated Area (Area 8)", AREA = 8
	)
)
zarriq_othman
Regular Visitor

Hi CNT,

 

Thank you for your quick response,  I tried the following solution but the result was still not working. I'm suspecting because of that warning alert (Delegation Warning). Need ur help again CNT.

 

Thank you so much.

 

zarriq_othman_0-1638620193431.png

 

@zarriq_othman Could you share some screen shot of the App for me to better understand your need.

Below I attach the screenshot of the canvas and the code implemented inside the gallery item. Thanks

zarriq_othman_0-1638682885246.png

 

Search( 
 If( Dropdown1_17.Selected.Value = "All" && Dropdown1_15.Selected.Value = "All", 
  'TX Master List', 
  Dropdown1_17.Selected.Value <> "All" && Dropdown1_15.Selected.Value = "All", 
  Filter( 'TX Master List', Criticallity = Dropdown1_17.Selected.Value ), 
  Dropdown1_17.Selected.Value = "All" && Dropdown1_15.Selected.Value <> "All", 
   If( Dropdown1_15.Selected.Value = "Plant 1 (Area 1 & 4)", 
    Filter( 'TX Master List', (AREA = 1 || AREA = 4) ), 
    Dropdown1_15.Selected.Value = "Plant 2 (Area 2 & 3)", 
    Filter( 'TX Master List', (AREA = 2 || AREA = 3) ), 
    Dropdown1_15.Selected.Value = "Plant 3 (Area 5,6 & 7)", 
    Filter( 'TX Master List', (AREA = 5 || AREA = 6 || AREA = 7) ), 
    Dropdown1_15.Selected.Value = "Non Regulated Area (Area 8)", 
    Filter( 'TX Master List', AREA = 8 ) 
  ), 
  Dropdown1_17.Selected.Value <> "All" && Dropdown1_15.Selected.Value <> "All", 
  Filter( 'TX Master List', Criticallity = Dropdown1_17.Selected.Value 
  // Here is the part that i want to implement the function ) ), 
txtSearch_1.Text, "Title" )

 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,691)