Forum Discussion
DateAdd Alternative for Function retrieving a Date, and Making a new Date
- 3 years ago
Hi NL-Nicolas,
This issue is caused by the first parameter in your DATEADD function. According to the syntax of DATEADD, you must provide a column that contains dates. And the dates argument can be any of the following:
1 A reference to a date/time column,
2 A table expression that returns a single column of date/time values,
3 A Boolean expression that defines a single-column table of date/time values.
For more details about the usage of DATEADD, please have a look at DATEADD function (DAX) - DAX | Microsoft Docs.
To solve this problem, you need make sure the first parameter is a date/time column by changing its date type or replace it with a date column from a Date/Calendar table. Here is a similar that may help you: Solved: DATEADD "expects a contiguous selection when the d... - Microsoft Power BI Community.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi NL-Nicolas ,
Is the DayfileSummary[DF_BusinessDay] formatted as a date or a date/time?
If date/time, try changing the data type to a date in Power Query then try the calculation again.
So it is formatted as a date and time, the DateADD function is the issue in question but it is needed to get the projected week 😞