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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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 @Anonymous 

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.

Anonymous
Not applicable

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

@Anonymous , 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.