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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

An Argument of Function DATE has wrong data type or result is too small or too large - PowerBi

Getting the error " An Argument of Function Date has wrong data type or result is too small or too large"

LAST 12 monthss =
var currentdate = MIN('Sheet1 (2)'[Current Date])
var previousdate = DATE(YEAR(currentdate), MONTH(currentdate)-12, DAY(currentdate))
 var result =  
CALCULATE(SUM('Sheet1 (2)'[Sheet1.Value]),
FILTER('Sheet1 (2)','Sheet1 (2)'[End of Month Date] >= previousdate  && 'Sheet1 (2)'[End of Month Date] <= currentdate))
return result

Please help how to solve this error in measure.
 

 

1 REPLY 1
FreemanZ
Super User
Super User

hi  @Anonymous

try like:

LAST 12 monthss =
var currentdate = MIN('Sheet1 (2)'[Current Date])
var previousdate = EDATE(currentdate, -12)
//DATE(YEAR(currentdate), MONTH(currentdate)-12, DAY(currentdate))
var result =  
CALCULATE(SUM('Sheet1 (2)'[Sheet1.Value]),
FILTER('Sheet1 (2)','Sheet1 (2)'[End of Month Date] >= previousdate  && 'Sheet1 (2)'[End of Month Date] <= currentdate))
return result
 
p.s. in the long run and in similar cases, you shall be working with Time Intelligence Functions. They are more handy and powerful.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.