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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
yh90
Regular Visitor

An Argument of Function Date has wrong data type or result is too small or too large

I'm calculating a year-over-year measure. The results are good, but sometimes the Matrix will not load and I get the error in the subject.

Here's what I have:

var _year = year(SELECTEDVALUE(Dates[week_end]))
var _month = month(SELECTEDVALUE(Dates[week_end]))
var _day = DAY(SELECTEDVALUE(Dates[week_end]))
var _this_year_date = date(_year,_month,_day)
var _last_year_date = date((_year - 1),_month,_day)

I've tried using DATEADD, but it doesn't work with DATE and SELECTEDVALUE (like my _this_year_date variable). I only have around 1.5M rows connected via Direct Query. Could it really be too big?

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@yh90 - It's likely too small of a value I would guess. SELECTEDVALUE returns blank if nothing is selected. You might try using it's optional parameter to return a default value if that is the case.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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