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! Learn more

Reply
SuddenClarity
Helper I
Helper I

Display last six months in visual based on user date selection

Essentially, I am trying to filter the axis of my line chart to only show the six months leading up to any given date based on user selections.

 

In my report I have two slicers for year and month. For example, assume the user selects 2012 and December. The line chart should then pick up on that filter context and only display July 2012 to December 2012 (prior six months), as per the below screenshot:

 

Example1.JPG

 

Similarily, if the user selects 2012 and March, the chart should display the following:

Example2.JPG

 

All the solutions I've found seem to only be for the last n months based on todays date. However, logically speaking, I need it to be based off of the max date in the current filter context. Does anyone know how I can acheive this? Thanks!

1 ACCEPTED SOLUTION
3 REPLIES 3
Ahmedx
Super User
Super User

Thanks, I followed the video instead and they do go through the solution without Tabular Editor. And it works in my case. Essentially, you would have to create a seperate "last 6 months" measure for each individual measure you want this filter applied on, but thats OK for my purposes. 

 

Thanks again!

I'm not sure if I understand this solution. They wrote that, "We implemented this logic in a calculation group named Previous Period with a calculation item that filters the last 6 months"

 

Does that mean I need to use calcualtion groups for this solution to work? I don't really have much experience with Tabular editor as my company does not allow it. Do you know if this solution can be reformatted to work with just PBI desktop? 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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