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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
luciebaize
Frequent Visitor

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!





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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.