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.
dpont quite undersatnd what you saying, can you put some results and expected results here?
- 12scml9 years agoResolver I
Of course! Here's a picture of what my results are. It's making week 1 start on Thursday, January 1, 2015 and end on Saturday the 3rd. I am trying to have week 1 start on Saturday, January 3rd, 2015 and go until Friday, January 9, 2015.
I looked into how the WEEKNUM function works, and it always makes week 1 the first week with a thursday in it, then either lets the week start on Sundays or Mondays. I want to make it so that week 1 is the first full week of the year, starting on Saturdays.- vanessafvg9 years agoCommunity Champion
so what is the problem with the duplicate date i dont understand?
why dont you split your date and time in powerquery, do the WEEKNUM(DATEADD([Dates],-2,DAY),1) (or similar) and then remerge it?
- 12scml9 years agoResolver I
The DATEADD([Dates],-2,DAY) part of the equation doesn't work because some of the dates in my [Dates] column are repeating.