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
julsr
Resolver III
Resolver III

DatesMTD error when using all the data in my database

Hello everyone! I'm using the datesMTD calculation to get Month To Date values. First, I used it with one year of data, and it worked. Now, I've tried using it for 13 years of information, and I'm getting the following error:

julsr_1-1726208824404.png

 

What could be wrong with it? What should I fix on my code (find it below) or in my database to fix this error? (both tables are joined by a Key that generates a many-to-many relationship)

 

TotalMTDValue =
CALCULATE(
    SUM(database[amount]),
    REMOVEFILTERS(DatesTable[Date],DatesTable[month],DatesTable[year],DatesTable[month_name]),
    DATESMTD(DatesTable[Date]),
    TREATAS(
        VALUES(DatesTable[account_t]),
        database[type_account]
    )
)
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@julsr  Try using below DAX

 

DAX
TotalMTDValue =
CALCULATE(
SUM(database[amount]),
DATESMTD(DatesTable[Date])
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @julsr ,

 

At my knowledge, using time intelligence functions requires the date table to be continuous and non-repeating date range.

Does your date table contain duplicate dates? If so, please try using the calendar() function to create a date table.

 

Best Regards,

Wearsky

bhanu_gautam
Super User
Super User

@julsr  Try using below DAX

 

DAX
TotalMTDValue =
CALCULATE(
SUM(database[amount]),
DATESMTD(DatesTable[Date])
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.

Top Solution Authors
Top Kudoed Authors