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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Default Slicer for Year Month

Hello All, I need your help in creating a default slicer Option: 

Scenario: I want to create a slicer which always selected latest yearmonth as Default selection (for example when user open report on September2019 he has to see 2019-sep as selected) and he also able to select previous yearmonth data.

Query Mode: IMPORT

Data I have is for 2017,2018, 2019 and I also have date column and yearmonth column(yyyy-mmm). So, I want to create a slicer with default latest yearmonth as selected and also users can select other years data if they want to.

I also don't want my users to see selection like Text 'latestyearmonth' they just have to see 2019-sep, 2019-Aug so on....

 

Help me resolve this..!!!

 

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Anonymous 

I don't think there is a way to make the report default to "current month" without showing something like "current month" in the slicer.  It works this way because the filter from the slicer only sends the selection "current month" to the model.  The rows in the calendar table that are tagged as "current month" change when the month changes so the report follows the slicer.

If you can accept that then the column to add to your date table is something like.

Month Selection =
VAR TD =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
RETURN
    IF (
        DATE ( YEAR ( Dates[Date] ), MONTH ( Dates[Date] ), 1 ) = TD,
        "Current Month",
        FORMAT ( Dates[Date], "mmm-yyyy" )
    )
Anonymous
Not applicable

Thank you @jdbuchanan71 .But as per my requirement I want to label my field for present yearmonth as yyyy-mmm format not as "Current yearmonth"

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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