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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.