Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have what I thought was a measure with a simple DATEADD formula and a simple conditional to put in a zero where a blank may exist. It appears to be working for some but not all rows of data, where I have a non-blank value. All the values are from the same table. Approval_Date and Duration are facts. I am clearly missing something basic in my coding logic or my understanding of how the DATEADD function works. Here is the DAX Measure:
Thank you in advance for your help.
Mark
Solved! Go to Solution.
Hi @Anonymous
DATEADD returns a table, not a single value, so you can't use it the way you are trying to
DATEADD function (DAX) - DAX | Microsoft Learn
I'm not following your arithemetic. For example, are you adding 32 days duration to an Approval date of 28 Nov and getting a Close date of 10 July?
To fix this particular issue use this DAX instead
Close Date =
VAR ZeroDuration = IF(ISBLANK(MAXX('FULL PROJECT LIST','FULL PROJECT LIST'[Duration])), 1, (MAXX('FULL PROJECT LIST','FULL PROJECT LIST'[Duration])))
RETURN
SELECTEDVALUE('Full Project List'[Approval Date]) + 7*ZeroDuration
Regards
Phil
Proud to be a Super User!
Hi @Anonymous
DATEADD returns a table, not a single value, so you can't use it the way you are trying to
DATEADD function (DAX) - DAX | Microsoft Learn
I'm not following your arithemetic. For example, are you adding 32 days duration to an Approval date of 28 Nov and getting a Close date of 10 July?
To fix this particular issue use this DAX instead
Close Date =
VAR ZeroDuration = IF(ISBLANK(MAXX('FULL PROJECT LIST','FULL PROJECT LIST'[Duration])), 1, (MAXX('FULL PROJECT LIST','FULL PROJECT LIST'[Duration])))
RETURN
SELECTEDVALUE('Full Project List'[Approval Date]) + 7*ZeroDuration
Regards
Phil
Proud to be a Super User!
Phil,
Worked great. The only think I did differently was add an IF statement to "blank" the value if there is no Approval_Date to start with.
Thank you!
Mark
Phil, Thank you for responding. I will give that a try. Just wanted to clarify that the duration is weeks...which is why I have the multiplier of 7 in there. That is how that Nov 2022 date advances to Jul 2023. I will add a comment to my DAX for clarification.
Thanks.
Mark