Forum Discussion
Date Manipulation
- 6 years ago
That would work too, or you could just add "not" to what I sent before
=Table.SelectRows(#"Changed Type", each not Date.IsInPreviousNDays([date], 3))
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Here is one easy way to do this
1. Right click on your first query and choose Reference (so that you only load data once on refresh)
2. Click on the pull down on your Date column and choose Date Filters / In the Previous and choose 3 Days
You will get a step added that looks like this
=Table.SelectRows(#"Changed Type", each Date.IsInPreviousNDays([date], 3))
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years agoNot applicable
Thanks, mahoneypat ,
That sounds like it's just going to give me the last 3 days, where I want everything but what happened in the last 3 days.
However, I think I've found an answer based on information I found here: - Convert DateTime into Date in Query Editor using M function
#"Added Conditional Column" = Table.AddColumn(Source, "Custom", each if [Date] < DateTime.Date(Date.AddDays(Date.StartOfDay(DateTime.LocalNow()),-3)) then "Keep" else "Remove"),
This seems to give me what I want in a column, and then I can add a step to remove any row with "Remove" in that column. Happy to look at alternatives though if you think your option can also work?
- mahoneypat6 years agoMicrosoft Employee
That would work too, or you could just add "not" to what I sent before
=Table.SelectRows(#"Changed Type", each not Date.IsInPreviousNDays([date], 3))
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years agoNot applicable
Thanks mahoneypat 🙂