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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

Filter data with last 15 months

Hello All,
I want to filter data with last 15 months of data from max date
Please help

Thanks!

1 ACCEPTED SOLUTION
fahadqadir3
Super User
Super User

@Anonymous  You can create a new Custom Column in Power Query to present months difference from Max Date Month by using the following Power Query Formula

Filter 15 Months from Max Date.png

Date.Month([Date]) - Date.Month(List.Max(#"Sorted Rows"[Date])) + 
(Date.Year([Date]) - Date.Year(List.Max(#"Sorted Rows"[Date]))) * 12

greater than  15 days.png

Then apply a Filter on new column where months difference is greater than -15, so that only last 15 months data should be availble to use.

 

Regards,

Fahad Qadir

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

View solution in original post

2 REPLIES 2
fahadqadir3
Super User
Super User

@Anonymous  You can create a new Custom Column in Power Query to present months difference from Max Date Month by using the following Power Query Formula

Filter 15 Months from Max Date.png

Date.Month([Date]) - Date.Month(List.Max(#"Sorted Rows"[Date])) + 
(Date.Year([Date]) - Date.Year(List.Max(#"Sorted Rows"[Date]))) * 12

greater than  15 days.png

Then apply a Filter on new column where months difference is greater than -15, so that only last 15 months data should be availble to use.

 

Regards,

Fahad Qadir

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

kpost
Super User
Super User

Are you meaning the last 15 calendar months?  Or are you meaning (15months)*(~30days/month) = ~450 days?

Are you wanting this as a DAX measure or a visual-level filter or a page-level filter or a report-level filter?  Are you wanting to screen out data older than 15 months at the import level using Power Query?


When you say "max date" are you referring to a date selected in a slicer, or are you referring to today's date (whatever that happens to be), or are you referring to the latest date found in a certain table?

 

More information about the exact problem you're trying to solve is going to help us answer your question.  As much as you can provide.

 

///Mediocre Power BI Advice, but it's free///

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.