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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Fixed cumulative sum (current month)

I need to calculate an accumulated sum and use the accumulated value for the current month as a variable to add the value column for the other previous months. Example:

 

MêsValorAcumuladoResultado
Janeiro 101080+10=90
Fevereiro102080+20=100
Março103080+30=110
Abril104080+40=120
Maio105080+50=130
Junho106080+60=140
Julho107080+70=150
Agosto108080+80=160
Setembro109080+90=170
Outubro1010080+100=180
Novembro1011080+110=190

 

I created a measurement to return the value for the month of August, but when I put the measurement on the graph, I have the result below.

 

MêsValorAcumuladoResultado
Janeiro 101010+10 =20
Fevereiro102010+20=30
Março103010+30=40
Abril104010+40=50
Maio105010+50=60
Junho106010+60=70
Julho107010+70=80
Agosto108010+80=90
Setembro109010+90=100
Outubro1010010+100=110
Novembro1011010+110=120

 

I need the accumulated value of the current month (August) to add with the value column for each month.
can you help me?

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

Create an index column in Power Query

 

1.jpg

 

 

Then create these Calculated Columns

 

Ac = SUMX(FILTER('Table','Table'[Index] <= EARLIER('Table'[Index])),'Table'[Valor])

 

RE = 
var Augusto = SUMX(FILTER('Table','Table'[Mês] = "Agosto"),'Table'[Ac])
RETURN
Augusto + 'Table'[Ac]

 

1.jpg

 

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

3 REPLIES 3
harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

Create an index column in Power Query

 

1.jpg

 

 

Then create these Calculated Columns

 

Ac = SUMX(FILTER('Table','Table'[Index] <= EARLIER('Table'[Index])),'Table'[Valor])

 

RE = 
var Augusto = SUMX(FILTER('Table','Table'[Mês] = "Agosto"),'Table'[Ac])
RETURN
Augusto + 'Table'[Ac]

 

1.jpg

 

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Not very clear.

 

Can you share the expectd output?

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Anonymous
Not applicable

hi, @harshnathani I edited the post, was it clearer?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.