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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
poweryogesh
Frequent Visitor

Set default value of current year in slicer

poweryogesh_0-1643623330438.png

 I wanted to be pre-selected dynamically on the basis of the current year 
Thanks !!

6 REPLIES 6
v-yanjiang-msft
Community Support
Community Support

Hi @poweryogesh ,

According to your description, here's my solution.

1.In Power Query, right click the Year column, select Change Type>Date.

vkalyjmsft_0-1643963917541.png

2.Change the Format to 2001(yyyy).

vkalyjmsft_1-1643963978464.png

3.Click the expand button in the upper right corner of the slicer, select "Relative Date".

vkalyjmsft_2-1643964163813.png

4.Then select This Year, it will always show the current year.

vkalyjmsft_3-1643964297677.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

 

 

Thank you for the solution @v-yanjiang-msft .
However, I wanted this feature in a drop-down slicer as shown in my original post. 

poweryogesh_0-1643964729539.png

Year selection should be dynamically on the basis of today() function. and wanted to implement the same for the quarter slicer.
Thank you !! 

amitchandak
Super User
Super User

@poweryogesh , As of you have to create a custom column with This year or last year and default that

 


Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)

 

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

this option really nice for my scenario. i can even adding date hierachy to drill further. i have manage to change your solution to below so that am able to show year format for other year for easy reading. 

YearFilter = SWITCH(TRUE(),
year(rptTableName[WeekEnding])=year(today()),"Current Year",
FORMAT(rptTableName[WeekEnding],"YYYY")
)

yearfilter.jpg

 

Thanks


@amitchandak wrote:

@poweryogesh, As of you have to create a custom column with This year or last year and default that

 


Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)

 

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA

 


@amitchandak is there any other way without creating a custom column?

@poweryogesh , I doubt any other way as of now.

There are a few ideas around, You can vote - https://ideas.powerbi.com/ideas/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors