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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to set a default slicer value?

I have a month slicer which shows the last 13 months (by using Reletive Date in last 13 months). When a user first opens the report, I want the Month slicer to have the current month automatically selected. I also want the user to be able to select any of the other 12 months as well.

How can this be done?

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use ISFILTERED() function.

If the slicer was not filtered, then show the special value, if it was filtered, show the filtered value.

Something like below.

5.PNG

6.PNG

 

Best Regards,

jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use ISFILTERED() function.

If the slicer was not filtered, then show the special value, if it was filtered, show the filtered value.

Something like below.

5.PNG

6.PNG

 

Best Regards,

jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

@v-jayw-msft, thanks for the suggestions. I have created this measure below

 

SlicerMeasure1 = 

IF(ISFILTERED('dimDate'[YearMonth]), FORMAT(NOW(), "Mmm yyyy"), BLANK())
 
How do I use this to make the slicer automatically have Nov 2020 selected when the report opens?
 
amitchandak
Super User
Super User

@Anonymous , have a column like below in you date table and sort that on month year sort and save current month /this month on slicer

 

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

or

Month Type = Switch( True(),
eomonth([Date],0)= eomonth(Today(),0),"Current Month" ,
Format([Date],"MMM-YYYY")
)

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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