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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Cumulative total

Hi All,

I want to calculate the cumulative value for below table.

MonthActual
September0.4
October4.0
November0
December0
January0
February0
March0
April0
May0
June0
July0
August0

 

 

The expected output should be like below, I have data only for the month September and October. My Trendline should show all the months and the cumulative data should be calculated till month.

MonthActualCumulative
September0.40.4
October4.04.4
November00
December00
January00
February00
March00
April00
May00
June00
July00
August00
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Anonymous 

 

add a column with this code:

Month No. = 
month(DATEVALUE("2021/"&[Month]&"/01"))

 

then try this measure:

Cumulative 1 = 
Var _A =CALCULATE(sum('Table'[Actual]),filter(all('Table'),'Table'[Month No.]<=max('Table'[Month No.])))
return
if(max('Table'[Actual])=0,0,_A)

 

output:

VahidDM_0-1635546351925.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @Anonymous 

 

add a column with this code:

Month No. = 
month(DATEVALUE("2021/"&[Month]&"/01"))

 

then try this measure:

Cumulative 1 = 
Var _A =CALCULATE(sum('Table'[Actual]),filter(all('Table'),'Table'[Month No.]<=max('Table'[Month No.])))
return
if(max('Table'[Actual])=0,0,_A)

 

output:

VahidDM_0-1635546351925.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.