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
JEJP
New Member

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 'DATEhas the wrong data type or the result is too large or too small. What is wrong with my formula? Field GeboorteDatum (Birthdate) is a Date type.

 

PBI4.PNG

PBI3.png

1 ACCEPTED SOLUTION

@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 )

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @JEJP ,

I create a table to test, it works well, could you provide the desensitized example data for me to test.

Column =
VAR _a =
    DATE ( YEAR ( TODAY () ), MONTH ( 'Table'[Column1] ), DAY ( 'Table'[Column1] ) )
VAR _b =
    DATE ( YEAR ( TODAY () ) + 1, MONTH ( 'Table'[Column1] ), DAY ( 'Table'[Column1] ) )
RETURN
    IF ( TODAY () > _a, _b, _a )

vbinbinyumsft_0-1676270258127.png

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much. I already found the solution, but this formula also works!

tamerj1
Super User
Super User

Hi @JEJP 

try by using MONTH ( ) and DAY ( ) functions

Hi @tamerj1 ,

 

I still get the same error:

PBI5.PNG

@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 )

Thank you! I have tried to fill out the blank fields (not every birthday was filled out in the system). Now it works!

Unfortunately, it still doesn't work.

image.png

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.