Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Dynamically show 5 weeks of data from today

Hi All, 

 

Is there a way to dynamically show the next 5 weeks of data based on today's date? 

1 ACCEPTED SOLUTION

@Anonymous , You can use relative date slicer :https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

or create column like these and filter on that

Week Type = Switch( True(),
[start week]<=Today() && [end date]>=Today()-35,"Last 5 Week" ,
[start week]<=Today()+35 && [end date]>=Today(),"Next 5 Week" ,
[Week Name]
)

 

refer: https://www.youtube.com/watch?v=hfn05preQYA

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
himahady22
New Member

To dynamically display 5 weeks of data starting from today in Power BI, you can create a new column or measure that filters the data based on the current date and the range of 5 weeks. Here's a solution using DAX:

  1. If you're working with a Date column, you can create a new measure like this:

 

5_Weeks_Filter = 
IF (
    'Table'[Date] >= TODAY() &&
    'Table'[Date] <= TODAY() + 35,
    1,
    0
)

 

This measure checks if the date is within the next 5 weeks (35 days). You can then apply this filter to your visualizations.

  1. Alternatively, if you prefer to show exactly 5 weeks (Monday to Sunday), you can modify the formula to align with the week boundaries.

For more dynamic date range calculations, including the ability to see how many days, weeks, or months are between specific dates, you can use the custom calculators on my website: days from today.

I hope this helps! Let me know if you need further assistance

amitchandak
Super User
Super User

@Anonymous , Try measure like

 


measure =
var _max = today() +35
var _Min = Today()
return
calculate(sum(Table[Value]), filter(Date, Date[Date] <=_max && Date[Date] >=Min))

 

Also check

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit, 

 

I need to use it as a filter on a visual so that the visual constantly shows 5 weeks of data from Today (). Because of that, i'm trying to create a custom column that tags the dates as 'current  5 weeks' and it dynamically moves down each day. But i'm struggling with the logic

@Anonymous , You can use relative date slicer :https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

or create column like these and filter on that

Week Type = Switch( True(),
[start week]<=Today() && [end date]>=Today()-35,"Last 5 Week" ,
[start week]<=Today()+35 && [end date]>=Today(),"Next 5 Week" ,
[Week Name]
)

 

refer: https://www.youtube.com/watch?v=hfn05preQYA

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Worked like a charm! Thank you so much! 

Helpful resources

Announcements
Join our Fabric User Panel

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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.