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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
llealsantos
Frequent Visitor

Power BI: Dynamic Date Slicer Behavior

Hey all,

I have a date slicer that filters the last 14 months using a calculated column in the calendar table. When the "Last 14 Months" is selected on the slicer, it correctly displays only the last 14 months. However, when deselected, I’d like the slicer to show available years instead of months.

Is there a way to achieve this dynamic behavior?

Thanks!

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @llealsantos 

If I understood your question correctly, one way to achieve this is by modifying or adding a calculated column in your calendar table.

The column should return "Last 14 Months" if the date falls within the last 14 months. Otherwise, it should return the year of the date.

Then, you can use this new column as the slicer instead of the date column. This way, when "Last 14 Months" is selected, it will filter accordingly, and when it's deselected, it will show years instead.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

7 REPLIES 7
v-prasare
Community Support
Community Support

Hi @llealsantos,

As we haven’t heard back from you, we wanted to kindly follow up to check if the below solution provided for your issue worked? or let us know if you need any further assistance here?

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

v-prasare
Community Support
Community Support

hi @llealsantos,m

As we haven’t heard back from you, we wanted to kindly follow up to check if the below solution provided for your issue worked? or let us know if you need any further assistance here?

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

v-prasare
Community Support
Community Support

Hi @llealsantos

As we haven’t heard back from you, we wanted to kindly follow up to check if the below solution provided for your issue worked? or let us know if you need any further assistance here?

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

techies
Super User
Super User

Hi @llealsantos try creating dynamic bookmarks that allow users to toggle between

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978
Ritaf1983
Super User
Super User

Hi @llealsantos 

If I understood your question correctly, one way to achieve this is by modifying or adding a calculated column in your calendar table.

The column should return "Last 14 Months" if the date falls within the last 14 months. Otherwise, it should return the year of the date.

Then, you can use this new column as the slicer instead of the date column. This way, when "Last 14 Months" is selected, it will filter accordingly, and when it's deselected, it will show years instead.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

If I got your question correctly, try creating a calculated column like this:

SlicerOption = IF([Date] >= EDATE(TODAY(), -14), FORMAT([Date], "MMM YYYY"), FORMAT([Date], "YYYY"))

Use this in your slicer to dynamically switch between months and years based on selection.

parry2k
Super User
Super User

@llealsantos maybe leverage field parameters to change the values dynamically.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors