Power Bi relative date slicer

In this Power BI Tutorial, We will discuss the Relative Date Slicer and Date Filter in Power BI Desktop. By taking a simple example, I will show you how we can use the relative date slicer and date filter in PowerBI Desktop.

Power BI relative date slicer

Here my Requirement is, I have a SharePoint Online List and this list is having so many items. From those items, I want to retrieve the last seven days of data records.

As per my requirement, I have to retrieve the last seven days of data records. But also, You can retrieve last any days of the data records, next days of data records or today’s data records.

For that purpose, I have created a SharePoint Online List named Product Details. This list is having four columns as:

  • Product Name (Title): This is the by default Title column. Just I have renamed it to Product Name.
  • Product Quantity: This column is the Number data type that I have created.
  • Product Bill Date: This column is the Date/Time data type.
  • Product Sales: This column is the Currency data type.

Also, I have entered a number of items to the Product Details List as like the below screenshot.

filter the date using power bi
filter the date using power bi

To visualize the data record of the SharePoint Online List, Select the Product Sales field value from the Fields section and select any chart for data visualization. Here in this example, I have taken a Stacked column chart from the Visualizations section.

Once you will add the field value in the chart, then the data chart will appear like the below screenshot.

filter date using power bi
filter date using power bi

Now in Power BI Report, We have to add the Date filter to retrieve the last seven days of the data record.

To add the Date Filter in Power BI Report, Choose Slicer from the Visualizations section and put the Product Bill Date field value in the Field. Once you will choose the slicer, then the chart will display as shown below.

NOTE:

You must ensure that your Date/Time field should be like this below format:
mm/dd/yyyy“. So that the Relative Sicer Filter will appear otherwise not.
date filter using power bi
date filter using power bi

Now to filter the data, click on the drop-down option which is present on the top of the slicer. Select Relative from the drop-down.

power bi relative date filter
power bi relative date filter

After selecting Relative, the Product Bill Date will appear as below. Here, you can choose either Last, Next, or This day from the drop-down option. Suppose, If you want the last 15 days record, So you can choose the Last option from the drop-down.

Secondly, Enter the number that you want to view the data record. Suppose, You want 15 days record, So you can put 15 over there.

And the Last thing you should know is what type of date you want to view the data records. Suppose, You want to 15 days, So you can choose Days from the drop-down.

power bi dynamic date filter
power bi dynamic date filter

As per my requirement, I want the last 7 days data record, That’s why I have entered 7. Now you can see in the below screenshot, the other chart is displaying the total Product sales of the last 7 days.

set default value for slicer
set default value for slicer

At last, I have provided all the styles to the data visualization chart by using the Format section. As I have formatted styles like Font size, background color, font color, border, etc. Now my Report is looking like the below screenshot.

power bi relative date slicer
power bi relative date slicer

You may like the below Power BI articles:

Hence in this Power BI Tutorial, We discussed the Relative Date Slicer and Filter in Power BI Desktop. By taking a simple example, I have shown you how to use the relative date slier and filter in Power BI Desktop.

>