Forum Discussion
Anonymous
4 years agoNot applicable
DATEADD not working on certain date values
I have a calculated column in my data set (DataTable2019 Test) which is looking at a date column (History Date) subtracting one year from the date and then returning a custom formatted date. For full...
- 4 years ago
I'm guessing your date table doesn't have dates prior to 2020. DATEADD doesn't work by adding or subtracting from a given date, it returns a result from your date table shifted by the interval you've specified. If no dates exist prior to 2020, you won't get a result. Take a look at the DATEADD documentation for more info.
DATEADD function (DAX) - DAX | Microsoft Docs
NehaSingh_108
2 years agoNew Member
Hey,
Try adding .[Date] to your date column name while using it to create a DAX.
For example,
Created Date (Corrected) = IF(YEAR('Raw Dump'[Created Date])="2022", DATEADD('Raw Dump'[Created Date].[Date],-1,year),'Raw Dump'[Created Date])