Forum Discussion
HenryJS
Post Prodigy
6 years agoData Table: Weekend Ending Column
Hi all, I have the below data table. I require 2 columns to be added: Week Ending Weeks denoted by ending on the Sunday for previous week i.e. Week Ending 12/04 is for the week 06/04/20 - 12/...
- Anonymous6 years ago
Hi HenryJS ,
Can I know which formula used in calculated column "Calendar'[WeekDay]"? It should be just like below one:
Calendar'[WeekDay]=WEEKDAY(Calendar[Date],2)
Best Regards
Rena
HenryJS
Post Prodigy
6 years agoAnonymous thank you - that worked.
However it is not displaying the correct 'Week Ending' date.
For example below, it should be stating "W15 Week Ending 12/04/2020"
How can I ammend to reflect this?
WeekEnding Trial =
VAR myWeekNum = WEEKNUM([Date])
VAR myYear = YEAR([Date])
VAR myEndDate = CALCULATE(MAX([Date]),FILTER(ALL('Calendar'),YEAR([Date])=myYear && 'Calendar'[WeekNum]=myWeekNum && 'Calendar'[WeekDay]=7))
VAR myEndDate1 = IF(NOT(ISBLANK(myEndDate)),myEndDate,CALCULATE(MAX([Date]),FILTER(ALL('Calendar'),YEAR([Date])=myYear+1 && 'Calendar'[WeekNum]=1&&'Calendar'[WeekDay]=7)))
VAR myEndDate2 = IF(NOT(ISBLANK(myEndDate1)),myEndDate1,MAX([Date]))
RETURN "W" & myWeekNum & " Week Ending " & FORMAT ( myEndDate2, "dd/mm/yyyy" )
Anonymous
6 years agoNot applicable
Hi HenryJS ,
Can I know which formula used in calculated column "Calendar'[WeekDay]"? It should be just like below one:
Calendar'[WeekDay]=WEEKDAY(Calendar[Date],2) |
Best Regards
Rena