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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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