Forum

Dynamic Date range
 
Notifications
Clear all

Dynamic Date range

2 Posts
2 Users
0 Reactions
187 Views
(@craig)
Posts: 1
New Member
Topic starter
 

Hi everyone, first post so go easy on me...

I am trying to filter my power query report between 2 dates but these change each month so it needs to be dynamic. Essentially the date column needs to show all dates between the 25th of 2 months ago and the 24th of the current month.  And as said this needs to update each month to adjust to the current month.... If anyone can help me it would be great. Thanks!

 
Posted : 12/08/2022 6:36 pm
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Hi Craig,

I guess the easiest would be to create two variables in Excel and connect to them with PQ. The end_date could be calculated with:

=DATE(YEAR(TODAY()),MONTH(TODAY()),24)

 

and the start date would then be derived from that with:

=EDATE(end_date,-2)+1

 
Posted : 13/08/2022 12:42 am
Share: