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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Power query - filter date to show previous 12 months, excluding previous 3 months

Hi Everyone,

 

I'm looking for a way in Power Query to a filter date column to show previous 12 months, but exluding the previous 3 months.

 

For example, if current month is August, I want to exclude July, June, May, and only see results for April, March, Feb, Jan, Dec, Oct, Sept.

 

Thank you kindly for your assistance 🙂 

1 REPLY 1
JoeBarry
Solution Sage
Solution Sage

Hi @Anonymous 

 

In the date column just filter before today. Then Change the code to this at the each part

each [Date] < Date.AddMonths(Date.EndOfMonth(Date.From(DateTime.LocalNow()))+ #duration(1,0,0,0), -4))

 

Then filter the date to before lets say April and the change the code again at the each part to 

each Date.AddMonths(Date.EndOfMonth(Date.From(DateTime.LocalNow()))+ #duration(1,0,0,0), -15))

 

Hope this helps

 

Kind regards

Joe

If this post helps, then please Accept it as the solution

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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