Forum Discussion

ryan_mayu's avatar
ryan_mayu
Super User
7 years ago
Solved

Urgent! Need help!!

Hi , i have a sample data below.   How can I use DAX to get the below result? I want to get the total sales in of pervious three months. Jan=Jan, Feb=Jan+Feb Mar=Jan+Feb+Mar .... Sep=Ju...
  • PattemManohar's avatar
    PattemManohar
    7 years ago

    ryan_mayu Here is the measure for same...

     

    Test46Out = 
    CALCULATE(SUM(Test46CummSum[Value]),FILTER(ALL(Test46CummSum),Test46CummSum[Date] <= MAX(Test46CummSum[Date]) && YEAR(Test46CummSum[Date]) = YEAR(MAX(Test46CummSum[Date])) && DATEDIFF(Test46CummSum[Date],MAX(Test46CummSum[Date]),MONTH)<=2 ))