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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
natabird3
Continued Contributor
Continued Contributor

Date slicer and visual custom filter

Hello,

 

What i am trying to do is the following:

I have a date slicer where the user can select a range of dates. Usually the data is on a monthly basis so more than a month should not be selected unless someone is looking at the full year. Therfore, if i want to use the date slicer to apply to a page but only to affect certain visuals, this i can do with the interactions. Now, the question is if i want to have a time series displayed in a simple line chart visual that displays the last 13 months from the date it was selected on the date slicer, is there a way to do this dynamically? So i can filter the last 13 months on the visual, however if i change the date slicer my visual will not change as its pre-filtered. Is there a way maybe to add some sort of measure to be selected date slicer - 12 full calendar months?

 

Please let me know, thanks in advance. 

 

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi  @natabird3  ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

natabird3
Continued Contributor
Continued Contributor

First of all, Happy New Year.

 

Apologies for the delay in my response, and thank you for trying to help me on this. I was trying to implement the suggested solution, however haven't been able to do so successfully. When i add the measure created to my visual filter i am simply seeing a white visual and no data or graph dispalyed, white background only. Not sure why that is happening. 

v-xicai
Community Support
Community Support

Hi @natabird3 ,

 

Assuming the Date column in slicer visual is Calendar[Date], and you have put Data[Date] into Axis box of Line chart. What's more, there is no relationship created between the table Data and Calendar.

 

You can create measure Filter1 like DAX below, then put the Filter1 in the Visual Level Filter of Line chart visual , setting Filter1 as "is not blank".

 

Filter1=

var Selected= SELECTEDVALUE(Calendar[Date])

Return

IF (Data[Date]>EDATE(Selected,-13) &&Data[Date]<Selected, 1, BLANK())

 

Best Regards,

Amy

 

Community Support Team _ Amy

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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