Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Sidd_Kaush
Frequent 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.

@amitchandak 

2 ACCEPTED SOLUTIONS

Hi @Sidd_Kaush 

Its working fine, I hope you are using custom date table

 

vk_pbi_1-1684994498313.png

 

View solution in original post

Sidd_Kaush
Frequent Visitor

PBI1.pngIts 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+1
Var d=c+1
Var e= CALCULATE(Sheet1[Total Sales],ALL(Sheet1),FILTER('DATE','DATE'[MonthNo] in {c,d}))
Return If (e=blank(),0,e)

View solution in original post

4 REPLIES 4
Sidd_Kaush
Frequent Visitor

PBI1.pngIts 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+1
Var d=c+1
Var e= CALCULATE(Sheet1[Total Sales],ALL(Sheet1),FILTER('DATE','DATE'[MonthNo] in {c,d}))
Return If (e=blank(),0,e)
Sidd_Kaush
Frequent Visitor

Hello Its not working as it retrieves the same rows within the calculation.

Hi @Sidd_Kaush 

Its working fine, I hope you are using custom date table

 

vk_pbi_1-1684994498313.png

 

vk_pbi
Resolver II
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
    )
)
)

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.