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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
rohit1992
Frequent Visitor

Need Help with autoselecting slicer based on certain date conditions

Hi, I have a date slicer like this which consists of monthly dates with date being always 01 - 

rohit1992_0-1705402182611.png

Goal: I would want slicer to automatically select the YTD months.
Example: Suppose if the current date or the refresh date is 1st May 2024, it should automatically select Jan to May month of 2024 and deselect the other months.

Please guide how this can be done.
Thanks in advance!

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

Add this kind of column to your calendar table:

Current Year YTD = IF([Year]=YEAR(TODAY()) && [Month]<= MONTH(TODAY()),"Current Year YTD",[YearMonth])

ValtteriN_2-1705403867436.png

 


 

Then use that as a slicer:
ValtteriN_3-1705403891217.png

 


 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
rohit1992
Frequent Visitor

Thanks @ValtteriN , this gives clarity on how to proceed.

ValtteriN
Super User
Super User

Hi,

Add this kind of column to your calendar table:

Current Year YTD = IF([Year]=YEAR(TODAY()) && [Month]<= MONTH(TODAY()),"Current Year YTD",[YearMonth])

ValtteriN_2-1705403867436.png

 


 

Then use that as a slicer:
ValtteriN_3-1705403891217.png

 


 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






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

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.