Forum Discussion
Weeknum starting on Friday
- 9 years ago
The DATEADD([Dates],-2,DAY) part of the equation doesn't work because some of the dates in my [Dates] column are repeating.
- 9 years ago
then create a new column with date only and work out the week num with your calculation?
what error does it give? i still dont see how that is an issue, why does it care if there is more than one date the same? maybe thats me just with my sql mind on, why not format it as a date only for the calculation and leave the time bit off?
- 9 years ago
No, I don't have to! I've been working with them both though and both DATEADD and WEEKNUM work just fine with the times. I was able to solve the issue though by (I don't understand how this works) duplicating the column and then using the DAX function.
I'm not sure what happened, I didn't mean to accept the solution but am unsure of how to revoke it. When I try my funtion, I get this error:
A date column containing duplicate dates was specified in the call to function 'DATEADD'. This is not supported.
I created a new column and removed the duplicates, however this leaves all of the removed data points with no week number.
do you have to keep your date and time together? i did some googling and yes you are right, it doesn't like duplicate values
http://stackoverflow.com/questions/39679183/issue-with-dateadd-function-in-dax
- 12scml9 years agoResolver I
No, I don't have to! I've been working with them both though and both DATEADD and WEEKNUM work just fine with the times. I was able to solve the issue though by (I don't understand how this works) duplicating the column and then using the DAX function.