Forum Discussion
Anonymous
5 years agoNot applicable
Help with Week Ending Date DAX Column
Hello, Hopefully this is an easy one. I have the following column in my date table, which I use to calculate the last day of the week for each row: End of Week =
VAR DayNumberOfWeek = WEEKDAY(...
- 5 years ago
Hi,
This calculated column formula should work
='Date Table'[Date] + (7 - WEEKDAY('Date Table'[Date],2))
HotChilli
5 years agoCommunity Champion
Does the date table end before 7th March? The results from DATEADD have to be in the dates column, so to solve it you can construct the date without using dateadd or extend the date table
Anonymous
5 years agoNot applicable
HotChilli Thanks for your response.
The date range of the date table is taken from the earliest and latest dates in a date column from a fact table of timesheet data. So as it is now, the last date in the date table will never be later than the current day.
I can easily edit the date table in PQ to go a bit further into the future, but I would be interested to know how I could do a similar calculation to achieve the desired result without needing to do that (out of curiosity)?