The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 formula? Field GeboorteDatum (Birthdate) is a Date type.
Solved! Go to Solution.
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 )
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 )
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!
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.
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |