How to Add a Date Slicer in Power BI

Do you want to add a Date Slicer in Power BI? Well, in this Power BI tutorial, I will explain what is Power BI Date Slicer, Why we use a Date slicer in Power BI, and How to add a Date slicer in Power BI.

Also, we will discuss how to add a Date Hierarchy Slicer and a Dynamic Date Slicer in Power BI.

Power BI Date Slicer

A Power BI Date slicer filters the power BI report information on visualizations using the date type data presented in the data table. For example, we can display the sales value for the selected date range using the date slicer in Power BI.

In the following, we will see how to add a date slicer in Power BI and how to filter the data presented in the Power BI report for the selected date range.

Also Read: Power BI DAX Count [15 real examples]

Add a date slicer in Power BI

Let us see how we can add a date slicer in the Power Bi report canvas in Power Bi.

Power Bi date slicer filters the information on visualizations using the date type data. There are four types of Power BI date slicers and they are mentioned below:

  • Between
  • Before
  • After
  • List

In this example, I have used the sales table data, to filter the based on the date slicer visual in Power Bi.

Between date Slicer in Power Bi

  • Open the Power Bi desktop, and load the data into it using the get data option. Once the data has been loaded, create a power bi visualization by selecting the data fields from the fields pane.
  • Now, Click on the slicer icon presented in the visualization pane, and in the slicer visual, drag and drop the Order Date field name from the field pane for which you filter it.
Between date Slicer in Power Bi
Between date Slicer in Power Bi
  • In the Date Slicer, by default, it is set to the Between option to display the range of dates between the start and end date.
  • In the below screenshot, you can see the date slicer visual between the date ranges. Based on the filtered date that displays the Products in the Clustered column chart.
Relative date slicers
Relative date slicers

This is how to use the between-date slicer visual to filter the data value presented in the Power Bi report canvas.

Check out: Power BI Dax Min Filter [With 13 Examples]

Before date Slicer in Power Bi

  • Click on the slicer icon presented in the visualization pane, and in the slicer visual, drag and drop the Order Date field name from the field pane for which you filter it
  • Expand the down arrow presented in the slicer visual and choose the before option as shown below.
Before date Slicer in Power Bi
Before date Slicer in Power Bi
  • The before-date slicer basically deactivates the first input date value and gives all the data, and we can choose the end date value.
  • In the below screenshot, you can see that the clustered column visually displays the data based on the date selected in the before-date slicer.
Before date Slicer in Power Bi example
Before date Slicer in Power Bi example

This is how to use the before-date slicer visual to filter the data value presented in the Power Bi report canvas.

After the date Slicer in Power Bi

  • Click on the slicer icon presented in the visualization pane, and in the slicer visual, drag and drop the Order Date field name from the field pane for which you filter it.
  • Expand the down arrow presented in the slicer visual and choose the after option as shown below:
after date Slicer in Power Bi
after the date Slicer in Power Bi
  • The after-date slicer basically deactivates the last date value and we can choose the first input date value.
  • In the below screenshot, you can see that the clustered column visually displays the data based on the date selected in the after-date slicer.
after date Slicer in Power Bi example
after date Slicer in Power Bi example

This is how to use the after-date slicer visual to filter the data value presented in the Power Bi report canvas.

Have a look: Power BI DAX Min Date from Text

List date Slicer in Power Bi

  • Click on the slicer icon presented in the visualization pane, and in the slicer visual, drag and drop the Order Date field name from the field pane for which you filter it.
  • Expand the down arrow presented in the slicer visual and choose the list option as shown below:
list date Slicer in Power Bi
list date Slicer in Power Bi
  • The list-date slicer basically displays all the date values in the list format, and we can choose the data based on the requirement.
List date Slicer in Power Bi example
List date Slicer in Power Bi example

This is how to use the list-date slicer visual to filter the data value presented in the Power Bi report canvas.

This is how to add a date slicer in the Power Bi reports canvas in Power Bi.

Date Hierarchy Slicer in Power BI

Let us see how we can add the Date hierarchy slicer to the Power Bi report canvas in Power Bi.

First, we will see how to create a date hierarchy for the date column presented in the data table.

To achieve this follow the below steps:

  • Open the Power Bi desktop, and load the data into it using the get data option. Once the data has been loaded.
  • Now Expand the fields pane and choose the date column and click on the ellipsis icon and select Create Hierarchy option as below:
Date Hierarchy Slicer in Power BI
Date Hierarchy Slicer in Power BI
  • In the below screenshot, you can see that the date hierarchy has been created and highlighted.
Date Hierarchy Slicer in Power BI example
Date Hierarchy Slicer in Power BI example
  • Click on the slicer icon presented in the visualization pane, and in the slicer visual, drag and drop the Order Date hierarchy field name from the field pane for which you filter it.
Date Hierarchy Slicer in the Power BI
Date Hierarchy Slicer in the Power BI
  • In the below screenshot, you can see the date hierarchy slicer visual between the date ranges. Based on the filtered date that displays the Products in the clustered column chart.
Example of Date Hierarchy Slicer in Power BI
Example of Date Hierarchy Slicer in Power BI

This is how to can add the Date hierarchy slicer to the Power Bi report canvas in Power Bi.

Read: Power BI DAX Min Date Sum

Dynamic Date Slicer in Power BI

Here we will see how we can use the dynamic date slicer in the Power Bi report canvas in Power Bi.

Follow the below steps to achieve this:

  • Load the data table into the Power Bi desktop using the get data option. Once the data has been loaded. Select the New Table under the Modelling tab and apply the below formula:
Dynamic Date Filter = UNION(
    ADDCOLUMNS(DATESBETWEEN(Sales_Table[Order Date],TODAY()-150,TODAY()),"Type"," Default"),
   ADDCOLUMNS(CALENDAR(MIN(Sales_Table[Order Date]),MAX(Sales_Table[Order Date])),"Type"," Custom"))
  1. Dynamic Date Filter = New Table Name
  2. Sales_Table = Existing Table Name
  3. Order Date = Existing Column Name

In the below screenshot. you can see that the new table displays the data based on the condition applied.

Dynamic Date Slicer in Power BI
Dynamic Date Slicer in Power BI
  • Once the table has been created, In the Model section generate a relationship between an Existing Sales Table Order date column and the newly created table’s order date as below.
Dynamic Date Slicer in Power BI exampleDynamic Date Slicer in Power BI example
Dynamic Date Slicer in Power BI example
  • Now, in the power bi report canvas select the two slicer visuals and drag and drop the type column and the order date field from the Dynamic Date Filter table.
Examples of Dynamic Date Slicer in Power BI
Examples of Dynamic Date Slicer in Power BI
  • Select the clustered column chart from the visualization, and then drag and drop the sales and customer location fields from the field pane.
  • From the type slicer, choose the type as custom and select the custom date value and choose the date range as below:
  • Based on the filtered date that displays the sales occurred by the customer location in the clustered column chart.
Examples of Dynamic Date Slicer in the Power BI
Examples of Dynamic Date Slicer in the Power BI
  • In the same way, if we select the default type it changes the date value accordingly and displays the sale that occurred by the customer location in the clustered column chart.
Examples of Dynamic Date Slicer in a Power BI
Examples of Dynamic Date Slicer in a Power BI

This is how to use the dynamic date slicer in the Power Bi report canvas in Power Bi.

Furthermore, you may like some more Power BI tutorials:

In this Power BI tutorial, we discussed what is Power BI Date Slicer, Why we use a Date slicer in Power BI, and How to add a Date slicer in Power BI.

Additionally, we saw how to add a Date Hierarchy Slicer and a Dynamic Date Slicer in Power BI.

>