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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
DanChaos
New Member

Cummulative sum by month and year

Hi everyone, I'm having trouble getting the commulive sellings by month on my data. I have tried several options but the calculated field does not add the value of the last month.

Heres ha picture of what I'm trying to achive and the formula used on the calculated field:tablas.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I created the calendar table with the dates:

relaciones.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I also triyed this expression with no results either:

 

Año Acumulado = CALCULATE ( SUM ('Ene-Sep2017'[VALOR]);FILTER(ALL(Calendario[fecha]);Calendario[fecha]<= MAX(Calendario[fecha])))

Thanks for the help in advance, I'm new to power BI and just discovered this DAX world lenguage.

Daniel.

 

2 ACCEPTED SOLUTIONS

@DanChaos

 

OK, can you please tell me why are you using Calendar table to calculate your total sum but then in your table Month column is from your Ene-Sep 2017 table???

  • why not just use your Ene-Sep 2017 date field in calculating your total that way it will be easier for you:
  • Año Acumulado = CALCULATE ( SUM ('Ene-Sep2017'[VALOR]),FILTER(ALL('Ene-Sep2017'),'Ene-Sep2017'[fecha]<= MAX('Ene-Sep2017'[fecha])))

 

Hope this helps if not send me some sample data and I will help you.

 

 

Regards

Abduvali

View solution in original post

Hi @DanChaos,

 

Use this to calculate your running total:

  • VALOR running total in MES =
                                                     CALCULATE( SUM('Hoja1'[VALOR]),
                                                                          FILTER( ALLSELECTED('Hoja1'[mes]),
                                                                                     ISONORAFTER('Hoja1'[mes], MAX('Hoja1'[mes]), DESC)
                                                                                        )
                                                                           )

Capture42.PNG

Hope this will solve your issue =D

 

 

Regards

Abduvali 

 

 

View solution in original post

9 REPLIES 9
Abduvali
Skilled Sharer
Skilled Sharer

Hi @DanChaos,

 

 

Try this:

  • Año Acumulado = CALCULATE ( SUM ('Ene-Sep2017'[VALOR]),FILTER(ALL(Calendario),Calendario[fecha]<= MAX(Calendario[fecha])))

See if that works now =D

 

Regards

Abduvali

the values are not adding up, shows the same value as the originial:

 

 

tablas 2.jpgMan Indifferent

@DanChaos

 

OK, can you please tell me why are you using Calendar table to calculate your total sum but then in your table Month column is from your Ene-Sep 2017 table???

  • why not just use your Ene-Sep 2017 date field in calculating your total that way it will be easier for you:
  • Año Acumulado = CALCULATE ( SUM ('Ene-Sep2017'[VALOR]),FILTER(ALL('Ene-Sep2017'),'Ene-Sep2017'[fecha]<= MAX('Ene-Sep2017'[fecha])))

 

Hope this helps if not send me some sample data and I will help you.

 

 

Regards

Abduvali

It worked, thank you!!.

I used other table following the suggestions in other post about having a diferent table with the dates. In case I wanted to do a cummulative sum by year how does the formula change?.

 

@DanChaos,

 

Great that it worked =D

  • what do you mean by cumulative? is it running total you talking about?

 

Regards

Abduvali

Hi again, I just noticed that the sum is not working well, here's the pic:

 

Resultado 2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

Could it be the date format?, we use day/month/year; US usually uses month at the start.

I took 2 months of data in this file so you can work with it: data sample

 

thanks again for the effort.

Daniel

 

Hi @DanChaos,

 

Use this to calculate your running total:

  • VALOR running total in MES =
                                                     CALCULATE( SUM('Hoja1'[VALOR]),
                                                                          FILTER( ALLSELECTED('Hoja1'[mes]),
                                                                                     ISONORAFTER('Hoja1'[mes], MAX('Hoja1'[mes]), DESC)
                                                                                        )
                                                                           )

Capture42.PNG

Hope this will solve your issue =D

 

 

Regards

Abduvali 

 

 

Thank you, that did the trick!

You are welcome =D

 

 

Regards

Abduvali

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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