Building a multi-filter “Table View” in Power Apps (SharePoint List dataset)
This article turns your Power Fx expression into a reusable pattern for Canvas Apps where the dataset is a SharePoint list and the UI has:
- An opening screen (filters + “View results”)
- A table screen (Data table or Gallery showing the filtered rows)
We’ll use your formula as the core and make it production-friendly (naming, “All” option, delegation/performance, and SharePoint column types).
1) The starting formula (your baseline)
Filter( 'Coffee Machine Sales', (ddProduct.Selected.Result = "All" || 'Product Name' = ddProduct.Selected.Result) && (ddRegion.Selected.Result = "All" || Region = ddRegion.Selected.Result) && (ddYear.Selected.Result = "All" || Year = ddYear.Selected.Result))
At a high level, this is the classic optional filter pattern:
- If the dropdown = All, ignore that condition.
- Otherwise, enforce equality for that field.
This is exactly what Filter is designed for: return the set of records that match one or more criteria. (Microsoft Learn)
2) SharePoint list assumptions (what “Coffee Machine Sales” looks like)
In SharePoint, create or assume a list named:
- Coffee Machine Sales (SharePoint List)
Example columns:
- Product Name (Single line of text)
- Region (Choice or Single line of text)
- Year (Number or Choice)
Power Apps integrates well with SharePoint lists and supports filtering scenarios like this. (Microsoft Learn)
A note about column names
- In Power Fx, SharePoint columns with spaces often need single quotes:
'Product Name'. - To make life easier long-term, many teams use clean column names (e.g.,
ProductName) and keep the friendly label for the UI.
3) Screen map (what you asked for)
Screen A — Opening screen (filters + CTA)
Name: scrHome
Controls:
ddProduct(Drop down)ddRegion(Drop down)ddYear(Drop down)btnViewResults(Button)
Goal: user selects filters, then navigates to the results screen.
Screen B — Table screen (results)
Name: scrTable
Controls (choose one):
- Data table control (simple grid-style view) (Microsoft Learn)
or - Gallery (more flexible layouts) (Microsoft Learn)
4) Wiring navigation between screens
On btnViewResults.OnSelect:
Navigate(scrTable, ScreenTransition.Fade)
That’s enough for navigation. The filtering itself can live on the table control’s Items property (recommended), so it always reflects the latest dropdown choices.
5) Setting up the dropdowns (including the “All” option)
Your formula uses ddX.Selected.Result, which implies your dropdown Items is a single-column table named Result.
Option 1 — Text columns (fast to implement)
If Product Name, Region, Year are stored as text/number columns, you can build dropdown items like this:
Product dropdown (ddProduct.Items)
Table({Result: "All"}) &SortByColumns( Distinct('Coffee Machine Sales', 'Product Name'), "Result", SortOrder.Ascending)
Region dropdown (ddRegion.Items)
Table({Result: "All"}) &SortByColumns( Distinct('Coffee Machine Sales', Region), "Result", SortOrder.Ascending)
Year dropdown (ddYear.Items)
Table({Result: "All"}) &SortByColumns( Distinct('Coffee Machine Sales', Year), "Result", SortOrder.Descending)
This matches your .Selected.Result approach.
Drop down controls show up to 500 items, so for very large distinct sets, consider narrowing choices or using a Combo box. (Microsoft Learn)
Option 2 — SharePoint Choice columns (recommended when Region is a Choice)
If Region is a SharePoint Choice column, you often work with the .Value field (because Choice is a record-like type). SharePoint delegation depends on subfields for complex types. (Microsoft Learn)
A common pattern is:
// Example for a SharePoint Choice column named Region// (You told me this is your preferred lab pattern)Table({Value:"All"}, Choices('Coffee Machine Sales'[@Region]))
This uses Value instead of Result, so your filter line would also use .Selected.Value and compare Region.Value.
Example filter condition for Region (Choice):
(ddRegion.Selected.Value = "All" || Region.Value = ddRegion.Selected.Value)
(Choices returns possible values for a column and is commonly used to drive dropdown/combobox selections.) (Microsoft Learn)
6) The table screen: bind Items to the Filter
If you use a Data table
Set DataTable1.Items:
Filter( 'Coffee Machine Sales', (ddProduct.Selected.Result = "All" || 'Product Name' = ddProduct.Selected.Result) && (ddRegion.Selected.Result = "All" || Region = ddRegion.Selected.Result) && (ddYear.Selected.Result = "All" || Year = ddYear.Selected.Result))
Then choose which fields the Data table displays (Product Name, Region, Year, Sales, etc.). Data table is made exactly for showing datasets with headers. (Microsoft Learn)
If you use a Gallery
Set Gallery1.Items to the same Filter and design a nicer row template (icons, formatting, conditional colors, etc.). Galleries are more flexible for UX. (Microsoft Learn)
7) A more maintainable version of your formula (same logic, cleaner)
When you repeat ddX.Selected.Result multiple times, it’s easy to mistype and harder to refactor. A common Power Fx improvement is to use With() to store selected values once:
With( { vProduct: ddProduct.Selected.Result, vRegion: ddRegion.Selected.Result, vYear: ddYear.Selected.Result }, Filter( 'Coffee Machine Sales', (vProduct = "All" || 'Product Name' = vProduct) && (vRegion = "All" || Region = vRegion) && (vYear = "All" || Year = vYear) ))
Same behavior, easier to read, easier to debug.
8) Delegation and performance (critical for SharePoint lists)
This pattern can be delegable, but delegation depends on:
- the data source (SharePoint),
- the operators you use,
- the column types involved.
Power Apps delegation exists so large datasets can be filtered server-side instead of only returning the first chunk of records. If your query isn’t delegable, you risk missing records beyond the delegation limit. (Microsoft Learn)
Practical tips for this exact pattern
- Prefer simple comparisons (
Field = Value) and combine withAnd/Or(SharePoint can delegate many of these). (Microsoft Learn) - Be careful with complex types (Choice/Person/Lookup): filter on the correct subfield like
.Valueor delegable subfields. (Microsoft Learn) - Consider indexing SharePoint columns you filter frequently (a SharePoint-side performance best practice).
- If distinct dropdown values become heavy, you can predefine options (for Region) using
Choices(...)or even a small reference list.
9) Common troubleshooting checklist
- Nothing shows in the table:
Confirm the dropdownItemscolumn name (ResultvsValue) matches what you use in.Selected.<field>. - Choice column mismatch:
If Region is Choice, comparingRegion = "East"may fail. TryRegion.Value = "East"and align dropdown values accordingly. (Microsoft Learn) - Delegation warning appears:
Re-check column types and whether you’re filtering on delegable subfields (especially Choice/Person). Use the delegation guidance to confirm which parts are delegable. (Microsoft Learn)
