Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
prvn8887
New Member

Date function for excluding last 3 months along and current month as well

I need help to exclude last 3 months data and current month data. Example: as of today I need data till 31st May 2023. Please help it's urgent. Thanks!

2 REPLIES 2
123abc
Community Champion
Community Champion

In Power BI, you can create a DAX measure to filter and exclude the last 3 months' data along with the current month's data. Assuming you have a date column named "Date" in your data table, you can use the following DAX measure to achieve this:

 

FilteredData = FILTER ( YourTableName, -- Replace with the name of your data table YourTableName[Date] < DATE(YEAR(TODAY()), MONTH(TODAY()), 1) && -- Excludes the current month YourTableName[Date] >= DATE(YEAR(TODAY()), MONTH(TODAY()) - 3, 1) -- Excludes the last 3 months )

 

Replace YourTableName with the name of your data table. This measure filters the data to include only rows where the date is earlier than the first day of the current month (excluding the current month) and no more than 3 months ago.

You can then use the "FilteredData" measure in your visualizations to display data up to the end of May 2023 if today's date is in June 2023.

image.jpg

 it's showing error as name DATE wasn't recognised. I'm working on power query and column name is PMTSUMMARY.......

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.