Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi All,
Is there a way to dynamically show the next 5 weeks of data based on today's date?
Solved! Go to 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
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:
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.
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
@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
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]
)
Worked like a charm! Thank you so much!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
80 | |
60 | |
35 | |
35 |
User | Count |
---|---|
100 | |
60 | |
56 | |
46 | |
41 |