Can dates be filtered between two specific dates in Power BI?

Yes, dates can be filtered between two specific dates in Power BI. This can be done by using the date filter option and selecting the desired start and end dates. The data will then be filtered to only show records that fall within the selected date range. This feature is useful for analyzing data within a specific time period and gaining insights into trends and patterns.


You can use the following syntax in DAX to filter a table for rows where a date column is between two specific dates:

filtered_data =
CALCULATETABLE (
    'my_data',
    DATESBETWEEN ('my_data'[Date], DATE(2022, 5, 1), DATE(2023, 8, 20))
)

This particular example creates a new table named filtered_data that contains only the rows from the table named my_data where the date in the Date column is between 5/1/2022 and 8/20/2023.

The following example shows how to use this syntax in practice.

Example: How to Filter Between Two Dates in Power BI

Suppose we have the following table in Power BI named my_data that contains information about sales made on various dates at some company:

Suppose we would like to filter the table to only show the rows where the date in the Date column is between 5/1/2022 and 8/20/2023.

To do so, click the Table tools tab and then click the New table icon:

Then type the following formula into the formula bar:

filtered_data =
CALCULATETABLE (
    'my_data',
    DATESBETWEEN ('my_data'[Date], DATE(2022, 5, 1), DATE(2023, 8, 20))
)

This will create a new table named filtered_data that contains only the rows from the table named my_data where the date in the Date column is between 5/1/2022 and 8/20/2023:

Power BI filter between two dates

To filter using two different dates, simply change the start and end dates within the DATESBETWEEN function in the formula.

Note: You can find the complete documentation for the DATESBETWEEN function in DAX .

Additional Resources

x