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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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