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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

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 @Wilianfilho_ps ,

 

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 @Wilianfilho_ps ,

 

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 @Wilianfilho_ps ,

 

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)

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors