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

Calculate MTD

Hello, 

I am new to power bi and facing an issue where I have a table with two columns 1. Effective Date and 2. Quantity, here i have to calculate MTD and show it in a line chart, But the problem is I want this measure which selects each date starting from 1-1-2018 until 31-12-2019, The effective date column is not having all this dates.

So i have created a new date table starting from 1-1-2018 to 31-12-2019, I want a measure which automatically add up the previous value and gives me the result for each month.

 

I have attcahed the screen clip of my requirement, can anyone please help me.

 

 

Capture.PNG

1 REPLY 1
amitchandak
Super User
Super User

Please check two functions totalmtd and datesmtd

 

https://docs.microsoft.com/en-us/dax/totalmtd-function-dax

https://docs.microsoft.com/en-us/dax/datesmtd-function-dax

 

Make sure you create a calendar table and it is marked as the date in the model view

https://docs.microsoft.com/en-us/dax/calendar-function-dax

https://powerbi.tips/2017/11/creating-a-dax-calendar/

 MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date Filer]))

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.