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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

DatesMTD is not working

Hi, I've created a Date_Table using 

 

 

DATE_Table = CALENDAR(DATE(2023,01,01),DATE(2023,12,31))  

 

 

 and a Sale column with all 1's 

 

As I created a Calculated Column using DATESMTD function to get the cumulative sum of Sale, why did it return me all 1's again?

 

Rickytan_0-1675806208757.png

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

The Date Table is the Dim table which should have additional date related columns only such as Month, Year.  The Sales table (Fact table) should have the Date column and Sale column.  Create a relationship (Many to One and Single) from the Date column of the Fact table to the Date column of the Calendar Table.  to your slicer, drag Date from the Calendar Table and select a specific date in that slicer.  Write these measures

Total = sum(Data[Sale])

Total MTD = calculate([total],datesmtd(calendar[date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Padycosmos
Solution Sage
Solution Sage

Hope this video helps for the cumulative totals:

https://www.youtube.com/watch?v=y7ucCjtADsg

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors