excel - Sales at X month using Dax -


i have dax formula work out sales amount @ month x works out in 2 stages

cumulative

cumulativsalesx:=calculate(sum('all'[invoice amount]), datesinperiod(calendar[date], lastdate(calendar[date]),-x,month))   cumulativsalesx+1:=calculate(sum('all'[invoice amount ]), datesinperiod(calendar[date], lastdate(calendar[date]),-x+1,month)) 

then use difference calculate sales in x month

salesx =  cumulativsalesx - cumulativsalesx+1 

is there more efficient way of doing ?

thank b.


Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -