Forum Discussion

JEJP's avatar
JEJP
New Member
3 years ago
Solved

Formula Date doesn't work

Hello, I have made my Dax formula, but it still gives an error. It says that the An argument of function 'DATE' has the wrong data type or the result is too large or too small. What is wrong with my...
  • tamerj1's avatar
    tamerj1
    3 years ago

    JEJP 

    Please try

    Birthdaynext =
    VAR Items =
    SUBSTITUTE ( Medewerker[GebrooteDatum], "-", "|" )
    VAR TheYear =
    YEAR ( TODAY () )
    VAR TheMonth =
    PATHITEM ( Items, 2 )
    VAR TheDay =
    PATHITEM ( Items, 1 )
    VAR ThisYearX =
    IFERROR ( DATE ( TheYear, TheMonth, TheDay ), BLANK () )
    VAR NextYearX =
    IFERROR ( DATE ( TheYear + 1, TheMonth, TheDay ), BLANK () )
    RETURN
    IF ( TODAY () > ThisYearX, NextYearX, ThisYearX )