- 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
Join our Fabric User Panel
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Power BI Monthly Update - June 2025
Check out the June 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
05-12-2025 03:22 PM | |||
07-15-2018 07:48 AM | |||
06-04-2025 05:50 PM | |||
01-04-2023 06:47 AM | |||
05-27-2025 07:34 AM |
User | Count |
---|---|
9 | |
6 | |
6 | |
6 | |
6 |
User | Count |
---|---|
9 | |
9 | |
8 | |
6 | |
6 |