Power BI: Create a relative date slicer for dynamic filters
In Power BI it is often desirable to filter reports on a dynamic date range, for example the last 7 or 30 days. With a relative date slicer you can set this up easily, so your report always shows current data without manual adjustments.
In Power BI it is often desirable to filter reports on a dynamic date range, for example the last 7 or 30 days. With a relative date slicer you can set this up easily, so your report always shows current data without manual adjustments.
In Power BI it is often desirable to filter reports on a dynamic date range, for example the last 7 or 30 days. With a relative date slicer you can set this up easily, so your report always shows current data without manual adjustments. In this article you will learn how to add and configure a relative date slicer, making your BI reports more flexible and user-friendly.
What you need
-
A date column in your dataset that is correctly formatted as a date type
-
A date table in your Power BI model (optional but recommended for better filtering)
-
Power BI Desktop or access to the online environment
Step 1: Check that you have a date column
The relative date slicer only works with columns formatted as date. Check in your data model whether the date column has the correct data type. This is important because otherwise Power BI cannot apply the slicer correctly.
Open your Power BI report and go to the data view. Select the date column and check in the right panel whether the data type is set to ‘Date’. If not, change it to the date type.
Step 2: Add a relative date slicer to your report
Go to the report view and add a slicer via the visualisation pane. Then drag your date column to the ‘Value’ field of the slicer.
Click on the slicer and open the dropdown menu at the filter type. Choose ‘Relative date’ here. This allows you to set the slicer to show, for example, the last 7 days, 30 days, or another period.
Step 3: Configure the relative date slicer
Set the desired period in the slicer menu, for example ‘Last 30 days’. You can also choose other options such as ‘Next’ or ‘This’ to show different dynamic date ranges.
This setting ensures your report is automatically filtered on the chosen relative date range, without you having to adjust it manually when new data arrives.
Tips & common mistakes
-
Always use a date column with the correct data type to avoid errors.
-
Adding a date table improves the performance and flexibility of your filters.
-
Note that the relative date slicer only works with date fields, not with text or numeric dates.
-
Check whether your timezone settings produce unexpected results with dynamic dates.
Example: Dynamic sales report
Suppose you have a sales report and you always want to show sales from the last 30 days. With the relative date slicer you set this up easily, so the report automatically updates when new data arrives. This keeps your report current and relevant for daily analyses.
Conclusion
With a relative date slicer you make your Power BI reports more dynamic and user-friendly. Try this functionality directly in Power BI Desktop or the online environment and experience the ease of current filters.
Our tip: Check the data type of your date column before adding a relative date slicer. If the column is stored as text, Power BI does not recognise the field as a date and you cannot set a relative date filter. Change the data type in Power Query to ‘Date’ to prevent this problem, and then link the column to a date table for best performance.
Frequently asked questions
What tips and common mistakes are there?
- Always use a date column with the correct data type to avoid errors. - Adding a date table improves the performance and flexibility of your filters. - Note that the relative date slicer only works with date fields, not with text or numeric dates. - Check whether your timezone settings produce unexpected results with dynamic dates.
How do I set up a relative date slicer in Power BI?
Add a slicer to your report via the visualisation pane and drag a date column to the value field. Click the arrow next to the slicer and choose 'Relative date' as the filter type. Set the desired period, such as 'Last 30 days' or 'This month'. The slicer now automatically filters the report on that dynamic range, without you having to update it manually when new data arrives.
Why does my relative date slicer not work correctly in Power BI?
First check whether the date column has the correct data type: it must be 'Date' or 'Date/time', not text or a number. Also check whether the column is linked to a date table in the model, because without that link, time intelligence functions may give incorrect results. Finally: if the timezone of your Power BI environment differs from that of your users, the boundaries of 'today' and 'this week' may fall differently than expected.