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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.