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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
fmouhcine
Frequent Visitor

Add new calculated Column for Monthly Cumulative total based on date & category

Dear Community,

 

I will need your support please I want to add a calculated column to an existing table where I do have: Date / Country / Volume

 

Below you can see an example from Excel were I have created manually a new column where I m calculating the Monthly Cumulative volume based on the date (should be for the same month & year) & the country

 

Capture.PNG

 

Thanks in advance for your support

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@fmouhcine , Try a new column like

 

Sumx(Filter(Table, [ctry] = earlier([Ctry]) && [Date] <= earlier([Date]) ) , [Volume])

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@fmouhcine , Try a new column like

 

Sumx(Filter(Table, [ctry] = earlier([Ctry]) && [Date] <= earlier([Date]) ) , [Volume])

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Many thanks for your reply - that works however the main objective is to have the monthly cumulative, meaning the cumulative must be rest at the beginning of each month.

So I have added additional conditions to mutch the month & the year as below:

VAR _Cumul = SUMX(
                FILTER(Table,
                [Ctry] = EARLIER([Ctry]) &&
                [Date] <= EARLIER([Date]) &&
                MONTH([Date]) = Month(EARLIER([date])) &&
                YEAR([Date]) = YEAR(EARLIER([date]))),
                [Volume]
                )
 
Cheers.
Mouhcine

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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