Forum Discussion

jurkowskij's avatar
jurkowskij
Frequent Visitor
3 years ago
Solved

Problem with 12 months Trend Calculating (Date Hierarchy)

I'm trying to figure out a way to use 12 month trend with date hierarchy   Formula I use Trend 12 M = CALCULATE( [Qty] ,DATESINPERIOD(Sales[OrderDate],max(Sales[OrderDate]),-12,MONTH) ...
  • lbendlin's avatar
    lbendlin
    3 years ago

    Your data model needs some changes. The Calendar table is a dimension table and needs to have a 1:*, single direction relationship to your fact (Sales) table. 

     

    Next step is to use the date from the dimension, not from the fact. Then your calculations will work.

     

    see attached