Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Rolling 12 months data

Hi amitchandak , 

I am using this measure for getting 12 months back data on my line chart but facing some issues in it.

Rolling 12 Graph 2 =

VAR _MAX = MAXX(ALLSELECTED('Date'),'Date'[Date])
VAR _MIN = DATE(YEAR(_MAX)-1, MONTH (_MAX), DAY(_MAX))
VAR Result =
CALCULATE(
SUM(TableName[SCORE1]),
FILTER(ALL('Date'),
 
'Date'[Date]>= _MIN && 'Date'[Date] <= _MAX

)
)
RETURN
Result

But, in this measure where i have used SCORE1 , basically my SCORE1 is a measure and I was unable to use it there as a measure so, i have to convert it into a column SCORE1 , but still it is not giving me the desired result.

Can you please help me ?
Thanks !
  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous 

     

    I see your requirement now, to explain the dax to get last 12 month, please see this example pbix. And change the return expression to Count().

     

    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

10 Replies

    • parry2k's avatar
      parry2k
      Super User

      Anonymous I also have a solution at this post, check it out.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi parry2k , 

        Actually my requirement is somewhat complex , these suggestions didn't help me.

        Thanks !

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    How did you change [Score1] to a column? Can you provide the dax. Usually the dax for measure and column is different.

    Please elaborate more with a sample pbix.

     

    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
      

  • PradeepTh's avatar
    PradeepTh
    Frequent Visitor

    Hi,

    I am also facing the same issue. So, please share the link of above example: "example.pbix" again.

     

    Regards,

    Pradeep