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

How to Show MTD calculation ?

Dear All, 

 

I have a logic where I have to show data for MTD period. 

Sum (Sales)

where Date should be between 1st of the current system/selected month till max date of the selected date/Filter.

Eg:- If current_Date is 07-Feb-2024

Chart should show sales from 01-Feb-2024 till 07-Feb-2024 automatically.

 

If user select month filter as Jan-2024, then 

Chart should show sales from 01-Jan-2024 till 31-Jan-2024.

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1707357193850.png

Date = CALENDARAUTO()

vtangjiemsft_1-1707357218681.png

(2) We can create measures. 

Measure 3 = 
var _date=SELECTEDVALUE('Date'[Date])
var _date_start=DATE(YEAR(_date),MONTH(_date),1)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date_start && 'Date'[Date]<=_date))
Measure 4 = 
var _date=DATE(SELECTEDVALUE('Date'[Date].[Year]),SELECTEDVALUE('Date'[Date].[MonthNo]),1)
var _date_end=EOMONTH(_date,0)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date && 'Date'[Date]<=_date_end))

(3) Then the result is as follows.

vtangjiemsft_2-1707357428775.png

Best Regards,

Neeko Tang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1707357193850.png

Date = CALENDARAUTO()

vtangjiemsft_1-1707357218681.png

(2) We can create measures. 

Measure 3 = 
var _date=SELECTEDVALUE('Date'[Date])
var _date_start=DATE(YEAR(_date),MONTH(_date),1)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date_start && 'Date'[Date]<=_date))
Measure 4 = 
var _date=DATE(SELECTEDVALUE('Date'[Date].[Year]),SELECTEDVALUE('Date'[Date].[MonthNo]),1)
var _date_end=EOMONTH(_date,0)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date && 'Date'[Date]<=_date_end))

(3) Then the result is as follows.

vtangjiemsft_2-1707357428775.png

Best Regards,

Neeko Tang

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

audreygerred
Super User
Super User

Hello! You can use the TOTALMTD DAX Function to achieve this. You can enter it manual or use quick measures. The below measure assumes you have a measure for Sales and a date table.

Sales MTD =
TOTALMTD([Sales], 'Date'[Date])
 




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

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors