Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Rolling 12 Month Trend Line when selecting a month

So I am wanting to create a Trend Chart that will show a rolling 12 month trend line.  If I select Jan. 2019 as a slicer I want it to show from last January to this one in the trend.  

 

I have been trying to use the below link but this doesn't seem to be working:

https://community.powerbi.com/t5/Desktop/Possible-for-a-line-chart-to-show-a-rolling-12-months-where/td-p/351407

 

I tried this DAX calculation but all of the #'s are coming through the same no matter what month I look at...

 

Full Time Hires in last 12 month = CALCULATE(SUMX(FactHires, FactHires[FullTimeNbr]), DATESBETWEEN(DIMCalendar[DateKey], EDATE(TODAY(), -12), TODAY()))
 
 

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, I actually had found that after I posted this!

       

      One stupid question, how do I get the chart and the drop down box to sort in monthly order?  Right now they both go in alphabetical order...

       

       

      • blopez11's avatar
        blopez11
        Icon for Super User rankSuper User

        You'll have to specify another coumn to sort your month name by, say a numerical MonthOfYear field populated with 1 through 12 depending on the month name for the row

         

        You can do this in either the "Report" or "Data" view, by selecting the table then the field you are using in those visualizations, then in the Modeling tab select "Sort by Column" to specify your sort column