Forum Discussion
Anonymous
5 years agoNot applicable
DAX Trend function.
Hi everyone. I need help with a calculation with a Trend. The excel formula that we use is mannualy changed each month, but we want to have it in Power Bi without of course de mannualy calcul...
amitchandak
5 years agoSuper User
Anonymous , try a measure like given below with Date Table
Rolling 3 = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date]),-1),-3,MONTH)) ,
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],eomonth(MAX('Date'[Date]),-1),-3,MONTH), filter(Sales,not(isblank((Sales[Sales]))))))
Or
Rolling 3 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-1),-3,MONTH))