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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All
I am able to filter my dataset for Last month using
= Table.SelectRows(Source, each Date.IsInPreviousMonth([LoadDate]))
How would I amend this so I filter for 2 months ago only? So not the last two months as that would include last month, I only want the data for two months ago
Hope that is help. any assistance appreciated!
Solved! Go to Solution.
@Anonymous , For filtering data for last twomonths you can use
let
Source = ... , // Your existing data source
TwoMonthsAgoStart = Date.StartOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()), -2)),
TwoMonthsAgoEnd = Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()), -2)),
FilteredRows = Table.SelectRows(Source, each [LoadDate] >= TwoMonthsAgoStart and [LoadDate] <= TwoMonthsAgoEnd)
in
FilteredRows
Proud to be a Super User! |
|
@Anonymous , For filtering data for last twomonths you can use
let
Source = ... , // Your existing data source
TwoMonthsAgoStart = Date.StartOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()), -2)),
TwoMonthsAgoEnd = Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()), -2)),
FilteredRows = Table.SelectRows(Source, each [LoadDate] >= TwoMonthsAgoStart and [LoadDate] <= TwoMonthsAgoEnd)
in
FilteredRows
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |