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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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