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

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 III
Super User III

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 IV
Super User IV

@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

@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
Highlighted

@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

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

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

Sriram_86_0-1594360177968.png

 

 

 

Highlighted

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

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors