Slice based on user input
Allow the user to filter a view based on a form
Sometimes you want to create a dynamic chart where the user can customize the data being charted via a form control. Try changing the value in the Filter setting of the dashboard view to see how the chart changes in response.
Also see: tablet mode & fullscreen mode
How we built this app
We've got two tables: Data and Filter. The Data table has a collection of red items and blue items, with the red items being generally smaller than the blue ones. The Filter table has a single row that will act as the filter. The user will edit this row to control how the data is filtered (either showing red or blue). To get the behavior we want, we first created a slice of the Data table that filters it to only return rows with color equal to the value in the Filter table. We use the formula ANY(Filter[Color]) = [Color], which gets the single value from the Filter table and compares it to the [Color] column of the Data table. Then, we created a detail view for the Filter table that has a quick edit column for the Color column. That allows the user to quickly switch between colors. Then, we created a chart view of the data slice that shows a histogram of item sizes for rows in the slice. Lastly, we created a dashboard view with our filter and chart view.
This is a preview of the data sets used in the app.
This is a high-level model of both the data entities and the UI elements in the app.