- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Previous n months removing current month
I'm filtering a date column to get today and previous 12 months since today.
For example, today is 5/8/2023, so I want all data since 5/1/2022 - 5/8/2023. I'm using the following filter option, but it's removing all days in May 2023. How do I fix this?
So then if I check this and try to get dates in this month, my table is empty. Yes, I do have data for this month.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Anonymous,
Didn't notice you were working with datetime, small adjustment
Table.SelectRows( PrevStepName, each let d = Date.From( DateTime.FixedLocalNow()) in [DateTime] >= DateTime.From( Date.StartOfMonth( Date.AddYears( d, -1))) and [DateTime] <= DateTime.From( d ))
Ps. If this helps solve your query please mark this post as Solution, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Anonymous,
In the formula bar change the M code to:
Table.SelectRows( PrevStepName, each let d = Date.From( DateTime.FixedLocalNow()) in [Date] >= Date.StartOfMonth( Date.AddYears( d, -1)) and [Date] <= d )
Ps. If this helps solve your query please mark this post as Solution, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Anonymous,
Didn't notice you were working with datetime, small adjustment
Table.SelectRows( PrevStepName, each let d = Date.From( DateTime.FixedLocalNow()) in [DateTime] >= DateTime.From( Date.StartOfMonth( Date.AddYears( d, -1))) and [DateTime] <= DateTime.From( d ))
Ps. If this helps solve your query please mark this post as Solution, thanks!

Helpful resources
User | Count |
---|---|
11 | |
7 | |
5 | |
5 | |
4 |
User | Count |
---|---|
16 | |
14 | |
8 | |
6 | |
6 |