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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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...

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.