Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everyone
Im using power query to manipulate some data and i wand to date filer where a date is NOT within the previous N months. There is and option to filter if it IS within previous months but it isnt clear ho to request the opposite
Any help would be very much appreciated
Thank you
Hi @Zedders12345 - the Date.IsInPreviousMonths function is logical so it returns true/false, so you simply need to add "not" before the function to change from true (in previous months) to false. However, the function could return future dates, so it is best to exclude these.
//Return rows before and after the previous 3 months
Table.SelectRows(Source, each not Date.IsInPreviousNMonths([Date], 3))
//Return rows before and after the previous 3 months
Table.SelectRows(Source, each not Date.IsInPreviousNMonths([Date], 3)
and [Date] < Date.From(DateTime.FixedLocalNow()) )
User | Count |
---|---|
15 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |