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

Cumulative sums per month

Hi everyone !

 

I already made some research but what I found did not help me.

luciebaize_0-1718203365019.png

I want to have the cumulative sum for each month in a third column for actual year and in 4th column for last year.

The two first columns are built like this :

VolLastYear = CALCULATE(
Sum('COMPANY$Commision Entries'[Volume]),
FILTER('COMPANY$Commision Entries','COMPANY$Commision Entries'[Année]=[YearActual]-1)
)
 
VolActualYear = CALCULATE(
Sum('COMPANY$Commision Entries'[Volume]),
FILTER('COMPANY$Commision Entries','COMPANY$Commision Entries'[Année]=[YearActual])
)
My posting date is in the table COMPANY$Commision Entries in a date format.
 
I tried to use a quick measure proposed by Power BI, it works well for actual year but does not for last year (it stays blank), so I'm looking for something new.
I tried the multiple solutions proposed online but it seems that it is not for me.
 
 
Thank you for your help 🙂 
2 REPLIES 2
ExcelMonke
Super User
Super User

Hello,

You could consider a measure similar to your first one. Depending on how your month column is set up, you can consider doing it a couple different ways. 
If you have month as numbers (e.g. 1 - 12) you can consider:

VolLastYear = 
VAR _LastMonthJan = 
IF('COMPANY$Commision Entries'[MonthNumber] = 1, 12,'COMPANY$Commision Entries'[MonthNumber]-1)

VAR _LastMonthJanCalc = 
CALCULATE(
Sum('COMPANY$Commision Entries'[Volume]),
FILTER('COMPANY$Commision Entries','COMPANY$Commision Entries'[MonthNumber]=_LastMonth && 'COMPANY$Commision Entries'[Annee]-1)
)

VAR _LastMonthCalc = CALCULATE(
Sum('COMPANY$Commision Entries'[Volume]),
FILTER('COMPANY$Commision Entries','COMPANY$Commision Entries'[MonthNumber]=_LastMonth))

RETURN
IF('COMPANY$Commision Entries'[MonthNumber] = 1, _LastMonthJanCalc,_LastMonthCalc)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Hi, I'm sorry, it's not working, I want to result to be just as cumul AY for the previous year

luciebaize_0-1718267279649.png

 

The measure proposed by Power Bi for the actual year is this one, but when I try to adapt it, it is blank 

Cumul AY =
IF(
    ISFILTERED('CINOCO$Commision Entries'[Posting Date]),
    ERROR("Les mesures rapides de Time Intelligence peuvent être regroupées ou filtrées seulement par la hiérarchie de dates ou les colonnes de dates principales fournies par Power BI."),
    TOTALYTD([VolActualYear], 'CINOCO$Commision Entries'[Posting Date].[Date])
)

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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