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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MacBI
Regular Visitor

Dynamic Slicer

Hello,

 

I have a Week slicer in one of my reports. Every Friday, a new week is added to the slicer via the refresh. Currently, I have a reminder to go and manually update the slicer to select this new week every Friday. I'm wondering if there is a way I can make this dynamic? I.e. I would like the slicer to automatically default to the max week available. I've found ways to do this by converting the max week to a text value like "Current Week" however this doesn't work because my users wouldn't really know what week that refers to. Is there a way to do it by keeping the date format?

Here is a sample of how my data looks. So for last week, I manually had to select the 8th of September. 

MacBI_0-1694643177767.png

 

1 ACCEPTED SOLUTION

It's going to use the selected value in the slicer, so the slicer value itself can't have the date in it if you want it to be dynamic. What you can do as a workaround is add the actual selected date to the slicer header or title using a measure to for the selected date value (you'll need to format it with FORMAT()). You could have it read something like "Current week selected (mm/dd/yy - mm/dd/yy)" where the dates are the actual dates. 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@MacBI , You need to create a Column like

 

Week Type = Switch( True(),
[start week]<=Today() && [end date]>=Today(),"This Week" ,
[start week]<=Today()-7 && [end date]>=Today()-7,"Last Week" ,
[Week Name]
)

 

And save it for this week.

 

For week start and end date

 

https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...
https://medium.com/chandakamit/cheat-sheet-any-weekdays-week-start-date-just-one-variable-apart-6b2e...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello,

 

Thanks for getting back to me. The problem with this is I don't want to use Text like "Current Week", "Last Week", etc.. I have already implemented a solution just like that and my client did not like it. They want it to display the date.

It's going to use the selected value in the slicer, so the slicer value itself can't have the date in it if you want it to be dynamic. What you can do as a workaround is add the actual selected date to the slicer header or title using a measure to for the selected date value (you'll need to format it with FORMAT()). You could have it read something like "Current week selected (mm/dd/yy - mm/dd/yy)" where the dates are the actual dates. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.