Forum Discussion
Sidd_Kaush
3 years agoFrequent Visitor
Cumulative Total for Coming Two Months
Currently i am looking for an solution called cumulative total in months, Lets Say If there's June Month in the row context then it should show up the sales value for July abd August, Similary If there's July then it should show up sales for August abd September. So basically its the cumulative of two months together.
Its Not Working for me but i came up with below calculation and its working correct for me,
Test3 =Var a= SELECTEDVALUE(Sheet1[Dte])Var b=Month(a)Var c=b+1Var d=c+1Var e= CALCULATE(Sheet1[Total Sales],ALL(Sheet1),FILTER('DATE','DATE'[MonthNo] in {c,d}))Return If (e=blank(),0,e)
4 Replies
- Sidd_KaushFrequent Visitor
Its Not Working for me but i came up with below calculation and its working correct for me,
Test3 =Var a= SELECTEDVALUE(Sheet1[Dte])Var b=Month(a)Var c=b+1Var d=c+1Var e= CALCULATE(Sheet1[Total Sales],ALL(Sheet1),FILTER('DATE','DATE'[MonthNo] in {c,d}))Return If (e=blank(),0,e) - vk_pbi
Resolver II
Hi,
Hopefully, the below dax will works
IF( ISBLANK([Total Sales]),BLANK(), CALCULATE( [Total Sales], DATESINPERIOD( 'Date'[Date], MAX('Date'[Date]), 2,MONTH ) ) ) - Sidd_KaushFrequent Visitor
Hello Its not working as it retrieves the same rows within the calculation.
- vk_pbi
Resolver II