Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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 |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
15 | |
11 | |
9 |