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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Monteiro8029
New Member

How to dynamically change the date range on a slicer with a calculation item which display n months

Hi Guys,

I have created a dashboard where the requirement was to display the last 12 months(using calculation item) on all visualizations after a refresh. I was able to implement the solution and it is working perfectly fine. My Dashboard also consists of a Date slicer which, when selected, the visuals are responsive. However, when the calculation item is set to the last 12 months, I see the last 12 months on all my visuals, but the date slicer wouldn't change. The Date slicer range is set for all time which is functional and I can change my date range accordingly. But when I select the 12 months Calculation item, the date range should be set to 12 months, and Functional to select dates prior to it. 

I am trying to fix it, as it looks like a bug to the end user.
Hope I can get help and fix this issue.

1 REPLY 1
amitchandak
Super User
Super User

@Monteiro8029 , Create a measure that can filter dates and use that visual level filter on date range slicer

 

In case you are looking for 12 month trend based on selected value. The slicer need to be on an indepedent table

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -12) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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