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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
dboi
Regular Visitor

To select current year in my slicer when new data for current year

Hello, is there a way that the Power BI slicer will set or select the current year when data changes for the current year?

As of now, my data is only 2023, but soon it will be 2024. However, when I paste the data for 2024, I have to select the slicer and set it to 2024. Is there a way that Power BI will autodetect that there's a New Data for 2024 and set its slicer to 2024?

dboi_0-1707137384392.png

 

 

dboi_2-1707137424571.png


so when new data for 2024, this slicer should be 2024.

dboi_3-1707137479826.png

 




2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@dboi , One of the option is that, you use preselected slicer

amitchandak_0-1706855837260.png

 

Or you can have this column in you date table and deafult on this year

 

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

View solution in original post

Anonymous
Not applicable

Hi @dboi ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1707209511534.png

1.Create calculate columns

Year = YEAR('Table'[Date])
Month = MONTH('Table'[Date])
Day = DAY('Table'[Date])
IsCurrentYear = IF(YEAR('Table'[Date]) = YEAR(NOW()), "Current", "Not Current")

2.Create a slicer use Year, Month, Day and apply IsCurrentYear as the filter of the slicer

vheqmsft_3-1707209880247.png

vheqmsft_2-1707209861362.png
Because filters cannot act directly on slicers with hierarchical filed values, so we need to create columns contain Year, Month and Day. When we create the visual object above, the slicer is empty because it is the year 2024 and the original data does not exist for the year 2024.

vheqmsft_4-1707210320562.png

vheqmsft_6-1707210346415.png

When we add 2024 data to the data, slicer shows the option to display the data now

vheqmsft_7-1707210822947.png

Best regards

Albert He

 

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
Anonymous
Not applicable

Hi @dboi ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1707209511534.png

1.Create calculate columns

Year = YEAR('Table'[Date])
Month = MONTH('Table'[Date])
Day = DAY('Table'[Date])
IsCurrentYear = IF(YEAR('Table'[Date]) = YEAR(NOW()), "Current", "Not Current")

2.Create a slicer use Year, Month, Day and apply IsCurrentYear as the filter of the slicer

vheqmsft_3-1707209880247.png

vheqmsft_2-1707209861362.png
Because filters cannot act directly on slicers with hierarchical filed values, so we need to create columns contain Year, Month and Day. When we create the visual object above, the slicer is empty because it is the year 2024 and the original data does not exist for the year 2024.

vheqmsft_4-1707210320562.png

vheqmsft_6-1707210346415.png

When we add 2024 data to the data, slicer shows the option to display the data now

vheqmsft_7-1707210822947.png

Best regards

Albert He

 

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

@dboi , One of the option is that, you use preselected slicer

amitchandak_0-1706855837260.png

 

Or you can have this column in you date table and deafult on this year

 

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.