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
louie_c
Regular Visitor

Cumulative Total with 2 parameter columns

Asking for your kind help fellow Power BI Users. Thank you in advance for those who would take time to help 🙂

 

Sample File: Power BI Sample 

 

I am trying to have cumulative total per month with two other columns to consider (country and portfolio).

Need to have cumulative total for this month and last month.

Total is calculated using measures over DIM date, such as Date Filter say selects 21-Feb, table will show running total for Jan 1 to 25 in one column and Feb 1 to 21 on the next column.

 

 

DAX Measures Used:

 
Collections MTD (This Month) =
CALCULATE(SUM(DATA[Sales]),
FILTER(ALL(DATA[Date]),
DATA[Date] <= MAX('_Dim Date'[Date]) &&
DATA[Date] >= DATE(YEAR(MAX('_Dim Date'[Date])),MONTH(MAX('_Dim Date'[Date])),1) ) )
 
Collections MTD (Last Month) =
CALCULATE(SUM(DATA[Sales]),
FILTER(ALL(DATA[Date]),
DATA[Date] <= EDATE(MAX('_Dim Date'[Date]),-1) &&
DATA[Date] >= EDATE(DATE(YEAR(MAX('_Dim Date'[Date])),MONTH(MAX('_Dim Date'[Date])),1),-1) ) )

 

 

Sample screenshot, this one is the daily sales, need to add cumulative MTD sales:

 

louie_c_0-1653648526799.png

 

louie_c_1-1653648706707.png

 

 

 

 

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @louie_c 

I am a little confused... please check the pitture below.

vxiaotang_0-1653979890325.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

louie_c
Regular Visitor

Thanks. I tried #1 and it seems still shows daily thing and not cumulative. I'm trying #2 but can't seem to get it work.

 

If I can indulge further to ask from your precious time to do the solution on this demo file? WIll really appreciate your kindness for this. 🙌

Power BI Sample 

amitchandak
Super User
Super User

@louie_c , You can use datesmtd for that

 

example

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

 

Or have a month Day columns and month Rank 

Month Rank = RANKX(all('Date'),'Date'[Month Start date],,ASC,Dense)

Month Day = day([date])

 

 

measures

MTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank]) && [Month Day] <=max([Month Day])))
LMTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank])-1 && [Month Day] <=max([Month Day])))

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.