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
Mani1205
Helper II
Helper II

default slicer selection for Current month

Team,

 

I have a table which contains date from Jan 2020 to Dec 2020 and i have created a slicer as below,  selected may month date manually ... but i want to select always current month minus 2 months as a default selection ... is it possible to do? pls help.

 

Mani1205_0-1594030133366.png

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Mani1205 , Not possible to default slicer by function.

You can create a column like this and have the values selected

new column =

Switch( True(),

eomonth([Date],0) >= eomonth(Today(),-1),"Last to Last  Month" ,
eomonth([Date],0) >= eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

new column =

Switch( True(),

eomonth([Date],0) >= eomonth(Today(),-1),"Data  Month" ,
Format([Date],"MMM-YYYY")
)

 

and select last to last month or data month and save the slicer value

View solution in original post

v-yiruan-msft
Community Support
Community Support

Hi @Mani1205 ,

You can refer the content in the following link as workaround to achieve it.

Power BI - How to Set a Default Slicer Value

Best Regards

Rena

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

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Mani1205 ,

You can refer the content in the following link as workaround to achieve it.

Power BI - How to Set a Default Slicer Value

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Mani1205 , Not possible to default slicer by function.

You can create a column like this and have the values selected

new column =

Switch( True(),

eomonth([Date],0) >= eomonth(Today(),-1),"Last to Last  Month" ,
eomonth([Date],0) >= eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

new column =

Switch( True(),

eomonth([Date],0) >= eomonth(Today(),-1),"Data  Month" ,
Format([Date],"MMM-YYYY")
)

 

and select last to last month or data month and save the slicer value

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.