The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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 🙂
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.