Forum Discussion

SuddenClarity's avatar
3 years ago
Solved

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:

 

 

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

 

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!

3 Replies

    • SuddenClarity's avatar
      SuddenClarity
      Icon for Helper I rankHelper I

      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? 

    • SuddenClarity's avatar
      SuddenClarity
      Icon for Helper I rankHelper I

      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!