cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

How to set slicer default value of current month?

Hi Team,

 

My report displaying published month in slicer. Next month automatically need to change, But not changing .

 

Could you please help me, How to set Slicer default selected value is Current month. 

Slicer.PNG

 

Thanks in advance for your help.

 

Regards,

Sriram e

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to set slicer default value of current month?

Hi @Sriram_86 ,

 

I created two calculated columns like this.

Month = [Date].[Month]
Mark_Month = 
IF(
    [Date].[MonthNo] = MONTH( TODAY() ) && [Date].[Year] = YEAR( TODAY() ),
    "Current month",
    "Not current month"
)

And add the two calculated columns to the slicer visual.

v-lionel-msft_0-1594632606570.png

Each time the dataset is refreshed, the current month in the dataset is marked, and the default value of the slicer is always the current month.

 

Best regards,
Lionel Chen

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

8 REPLIES 8
Highlighted
Super User V
Super User V

Re: How to set slicer default value of current month?

Hi @Sriram_86 ,

 

 

Please check if this solution works for you. (pbix file is attached)

 

https://community.powerbi.com/t5/Desktop/Setting-the-Default-Value-of-a-Slicer/m-p/16442

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Highlighted
Super User IX
Super User IX

Re: How to set slicer default value of current month?

@Sriram_86 , In my Date table I create a month Name like this and select current month in Slicer

 

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

 

I also sort this on

Format([Date],"YYYYMM")

 

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

You can default value in slicer by function



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Regular Visitor

Re: How to set slicer default value of current month?

@amitchandak Thanks for your response. I dont have Calender table. My Main table have Date column. Is it possible to use my Main table Date column. if not possible please let me know, How to create Calender table. 

 

If you have any sample report, Please share.

 

Regards,

Sriram

Highlighted
Super User V
Super User V

Re: How to set slicer default value of current month?

Highlighted
Super User IX
Super User IX

Re: How to set slicer default value of current month?

@Sriram_86 , refer to my blog for a calendar of choice for financial years

 
Or
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: How to set slicer default value of current month?

Hi @Sriram_86 ,

 

Please refer to my .pbix.

Set the default value of the slicer to the current month. As the date column is updated, the default value of the slicer will always be the current month.

 

r1.PNG

 

Best regards,
Lionel Chen

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

Highlighted
Regular Visitor

Re: How to set slicer default value of current month?

Thanks for your response. Im unable to open your Power BI report. Getting error below error.

Sriram_86_0-1594360177968.png

 

 

 

Highlighted
Community Support
Community Support

Re: How to set slicer default value of current month?

Hi @Sriram_86 ,

 

I created two calculated columns like this.

Month = [Date].[Month]
Mark_Month = 
IF(
    [Date].[MonthNo] = MONTH( TODAY() ) && [Date].[Year] = YEAR( TODAY() ),
    "Current month",
    "Not current month"
)

And add the two calculated columns to the slicer visual.

v-lionel-msft_0-1594632606570.png

Each time the dataset is refreshed, the current month in the dataset is marked, and the default value of the slicer is always the current month.

 

Best regards,
Lionel Chen

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors