Sub topic 7
Basic, advanced, Top N, and relative date filters
This chapter covers the four filter types in the Filter pane and when each one fits. It assumes you can open the Filter pane, know the difference between visual, page, and report scopes, and know what columns and measures are in a data model.
Where the type is chosen
Drag a field into the Filter pane, or use one already there. The field's data type decides which filter types are offered. Text fields offer basic and advanced filtering. Numeric fields offer both of those and Top N. Date fields offer relative date filtering as well. Use the Filter type dropdown on the field's card to switch.
Most types apply when you change the card. Advanced, Top N, and relative date filters wait until you select Apply filter. If a visual does not change after you set one of these, you probably skipped that button.
Basic filtering
Basic filtering shows the field's values as a checklist. You tick the values to keep, and everything else is hidden. It is the default and the easiest for readers to understand.
Use it when the list of values is short and you know which ones you want. It becomes tedious with hundreds of values, and it does not adapt when new values arrive. A new category in the data stays hidden until someone ticks it, if you had selected specific values.
Advanced filtering
Advanced filtering builds a rule instead of a list. You choose a condition and a value. You can add a second condition joined with And or Or.
The available conditions depend on the data type:
| Data type | Example conditions |
|---|---|
| Text | contains, starts with, does not contain, is blank |
| Number | is greater than, is less than or equal to, is not blank |
| Date | is on or after, is before, is blank |
For example, the rule Product name contains "Bike" keeps every product with that text, including products added later. A rule on a number such as Sales amount is greater than 1000 And is less than 5000 keeps a range. A rule also keeps working after a data refresh, which a ticked list does not.
Top N filtering
Top N keeps only the highest or lowest items, ranked by a value you choose. You set three things:
- Top or Bottom.
- How many items to show.
- The By value field, which is usually a measure such as
Total Sales.
Top N is available only as a visual-level filter. The ranking depends on the fields in that visual, so it has no meaning at page or report scope. The By value field does not need to be shown in the visual.
A Top N filter ranks within the other filters already applied. If a slicer limits the data to one region, the top 5 products are the top 5 in that region. Ties at the cut-off can return more items than you asked for.
Relative date filtering
Relative date filtering keeps a window of time measured from today. It shows only for date fields. You choose a direction (is in the last, is in this, is in the next), a number, and a unit. The units include days, weeks, months, and years, plus calendar versions of each.
The calendar versions matter:
- Last 3 months is a rolling window that ends on today's date.
- Last 3 calendar months covers three whole months before the current one.
A toggle for Include today controls whether the current day counts. Because the window moves with the clock, a report using it needs no manual edits. A report titled "last 30 days" stays correct every time it is opened.
Combining filters
Several filters on one scope combine with And. A page filter for the last 12 calendar months and a visual-level Top N of 5 return the top 5 items within those 12 months. Filters at different scopes also combine, so a report-level filter cannot be undone by a visual-level one.
Exercise
A page shows a bar chart of sales by product. You want only the 10 best-selling products, and you want the chart to stay correct when sales change. Which filter type and scope do you use, and what goes in the By value field?
Show answer
Use a Top N filter at the visual level on the Product field, set to Top 10, with a sales measure such as Total Sales as the By value field. Then select Apply filter. Top N is available only at visual scope, and it recalculates the ranking whenever the data changes.