hi - i need some help with using multiple filters please.
I want to use 3 filters - Priority, Comapny and Status to filter the data shown on the page.
Priorty Filter field is called dropdown1 and contains ALL, Critical, Important, Normal, Unimportant as choices
Company Filter field is called dropdown 2 and similarly has ALL plus several options
Status fielter field is called, unsurprisingly, dropdown 3 and has the same ALL plus options set up
'IT Projects' is the source (Sharepoint List). Using just the first filter only i have this code that works fine....
Browsegallery1.items = If(Dropdown1.Selected.Value="All",'IT Projects',Filter('IT Projects',Priority.Value=Dropdown1.Selected.Value))
But i cant get my head around how to add a 2nd and 3rd look up. I started trying nested IFs but just got myself tied up in knots and confused.
Hope someone can help.
Solved! Go to Solution.
"If" can be used in-line to generate filter expressions, and the "Filter" function can contain multiple filter expressions, just separate them with commas. Instead of starting with "If", start with "Filter" and use several ifs to create the filter expressions. I think this is what you want:
Browsegallery1.Items = Filter('IT Projects',
Each if statement here says if the value is "All", just return all records where the value isn't blank, otherwise return values that match the dropdown.
Tip: You can add If() statements inside conditions of the Filter function.
Filter( 'IT Projects', If( PriorityDropdown.Selected.Value = "All", true, PriorityValue = PriorityDropdown.Selected.Value ), If( CompanyDropdown.Selected.Value = "All", true, CompanyValue = CompanyDropdown.Selected.Value ), If( StatusDropdown.Selected.Value = "All", true, StatusValue = StatusDropdown.Selected.Value ) )
I assumed names for the dropdowns and fields. Change names as necessary.
Also, the Filter() function can have more than 2 arguments. In the code above, it has 4. The last 2 are just additional conditions. And all conditions (arguments 2 - 4) are basically joined by AND operators (i.e. Condition1 AND Condition2 AND Condition3).
Let me know if it works.
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.