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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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