To filter data in Power Apps, use the Filter(DataSource, LogicalTest) syntax. This function scans a data source (like SharePoint, Dataverse, or Excel) and returns only the records that meet one or more specific conditions you define in the LogicalTest section. For example, Filter(Employees, Department = "Sales") will display only the employees who belong to the Sales department.

What You'll Need

  • A Power Apps environment with an active license.
  • A connected data source (e.g., a SharePoint list, Dataverse table, or SQL Server table).
  • A control to display the filtered data, such as a Gallery or a Data Table.

Step-by-Step

  1. Select your display control: In the Power Apps Studio, click on the Gallery or Data Table where you want the filtered results to appear.
  2. Access the Items property: In the property dropdown menu (top left of the screen) or the Properties panel on the right, select the Items property. This is where you define which data the control should show.
  3. Enter the basic Filter function: Type Filter( followed by the name of your data source. For example, if your list is called ProjectTracker, type Filter(ProjectTracker, .
  4. Define your logical test: Add the column name you want to filter by, an operator, and the value you are looking for.
    • For text: Status = "Completed"
    • For numbers: Priority = 1
    • For booleans: IsActive = true
  5. Close the function: Add the closing parenthesis ). Your full formula should look like: Filter(ProjectTracker, Status = "Completed").
  6. Filter based on user input (Dynamic Filtering): To make the filter change based on what a user types in a Text Input control, replace the hard-coded value with the control's name. If your text box is named TextInput1, use: Filter(ProjectTracker, StartsWith(ProjectName, TextInput1.Text)).
  7. Add multiple conditions: To filter by more than one criteria, use the && (AND) operator or the || (OR) operator.
    • AND: Filter(ProjectTracker, Status = "Active" && Priority = "High") (Both must be true).
    • OR: Filter(ProjectTracker, Status = "Completed" || Status = "On Hold") (Either can be true).

Common Mistakes

  • Case Sensitivity: Depending on the data source, text comparisons may be case-sensitive. If "Sales" doesn't work, check if the data is stored as "sales".
  • Mixing Data Types: Trying to filter a numeric column using quotation marks (e.g., Price = "10") will cause an error. Numbers should not have quotes.
  • Wrong Operator: Using a single equals sign = is correct for comparison in Power Apps, but users coming from other languages sometimes mistakenly try to use ==.
  • Filtering the wrong property: Applying the Filter formula to the OnSelect property instead of the Items property. The Items property is the only place where the gallery knows what data to render.

Tips

  • Use Search for partial matches: If you need to find a keyword anywhere within a string (not just the start), use the Search() function instead of Filter().
  • Combine with SortByColumns: To keep your filtered list organized, wrap your filter inside a sort function: SortByColumns(Filter(ProjectTracker, Status = "Active"), "DueDate", SortOrder.Ascending).
  • Handle Empty Inputs: To show all records when a search box is empty, use an If statement or a logical check: Filter(ProjectTracker, IsBlank(TextInput1.Text) || StartsWith(ProjectName, TextInput1.Text)).
  • Use Variables for Complex Filters: If your filter logic is very long, set a variable in the OnSelect of a button using Set() or UpdateContext() and reference that variable in the Filter function.

Troubleshooting

If your filter is not returning the expected results or is showing an error, try these steps in order:

  1. Check for Delegation Warnings: Look for a blue underline beneath your formula. This indicates a "Delegation" issue, meaning Power Apps cannot ask the server to do the filtering and will only filter the first 500 to 2,000 records. To fix this, use delegable functions (like Filter and StartsWith) and avoid non-delegable ones (like Search on some data sources).
  2. Verify Data Source Names: Ensure the data source name and the column names are spelled exactly as they appear in the data source. Note that SharePoint internal names can sometimes differ from the display names.
  3. Test with Static Values: Replace your dynamic input (e.g., TextInput1.Text) with a hard-coded string (e.g., "Test"). If the static value works, the issue is with your input control, not the filter syntax.
  4. Refresh the Data Source: Go to the Data tab, find your connection, and select Refresh to ensure Power Apps is aware of any recent schema changes in your database.

Frequently Asked Questions

Can I filter a gallery by multiple dropdown selections?

Yes. You can use the && operator to link multiple dropdown values. For example: Filter(DataSource, Category = Dropdown1.Selected.Value && Region = Dropdown2.Selected.Value).

What is the difference between Filter and Search?

Filter is used for precise logical matches (equals, greater than, less than). Search is designed to find a specific string of text anywhere within one or more specified columns.

Why is my Filter function returning an empty list?

This usually happens due to a data type mismatch (e.g., comparing a number to text) or because the logical conditions are too restrictive (using AND when you should use OR), resulting in no records meeting all criteria.

How do I filter for blank or null values?

Use the IsBlank() function within your filter. For example: Filter(ProjectTracker, IsBlank(CompletionDate)) will show all records where the completion date has not been entered.

Does the Filter function work with Excel files?

Yes, but Excel has significant delegation limitations. If your Excel table is very large, the Filter function may only process the first few hundred rows unless the filter is performed on a delegable column.