How can I filter data in Power BI between two specific dates?

Power BI is a data visualization and business intelligence tool that allows users to analyze and present data in a visually appealing and interactive manner. One of its key features is the ability to filter data based on specific criteria, such as dates. This allows users to focus on a specific time period and gain insights from their data.

To filter data between two specific dates in Power BI, users can utilize the “Date” or “Date Range” filters. These filters can be applied to any visual element in a report, such as charts, tables, or graphs. Users can select a specific date or a range of dates, and the data will automatically be filtered to show only the relevant information.

This feature is particularly useful for businesses and organizations that need to analyze data over a certain period, such as sales data or financial data. By filtering the data between two specific dates, users can easily identify trends and patterns, and make informed decisions based on the insights gained.

In addition, Power BI also allows users to create custom filters based on specific date ranges, providing even more flexibility in data analysis. With its user-friendly interface and powerful filtering capabilities, Power BI makes it easy for users to extract valuable insights from their data between two specific dates.

Power BI: Filter Between Two Dates


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