Forum Discussion
ryan_mayu
7 years agoSuper User
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...
- 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 ))
ryan_mayu
7 years agoSuper User
Can I escalate this question?
I read your DAX, it works in a year. What about Jan 2019= Nov 2018+Dec 2018+Jan 2019?
Do you have any idea on how to solve this problem?
PattemManohar
7 years agoCommunity Champion
ryan_mayu Yes, Ofcourse !! In that case, try the same DAX by removing the YEAR condition in the FILTER.
- ryan_mayu7 years agoSuper User
PattemManohar, I will try that. Thanks a lot.