Forum Discussion
RMDNA
8 years agoSolution Sage
Create date columm from odd text format
Hi all, I'm running into an issue trying to create a date from an odd format. From the below table, we have Year, Week Num of Year, and Day of Week Num. I need to turn the first row into Febr...
- 8 years ago
HI RMDNA
Please give this calculated column a try
Column = VAR BaseDate = DATE(2018,2,1) RETURN BaseDate + ('Table 2'[DayOfWeekNum]-1) + ('Table 2'[WeekNum] * 7) - 7
Phil_Seamark
8 years agoMicrosoft Employee
HI RMDNA
Please give this calculated column a try
Column =
VAR BaseDate = DATE(2018,2,1)
RETURN
BaseDate +
('Table 2'[DayOfWeekNum]-1) +
('Table 2'[WeekNum] * 7) - 7
RMDNA
8 years agoSolution Sage
That seems to have worked. Scaling it out to additional years will be a future issue, but this should do for now. Thanks for the support.
- Phil_Seamark8 years agoMicrosoft Employee
Hi RMDNA
If I understand your data correctly, scaling it out to other years could be as easy as the following tweak
Column = VAR BaseDate = DATE('Table 2'[Year],2,1) RETURN BaseDate + ('Table 2'[DayOfWeekNum]-1) + ('Table 2'[WeekNum] * 7) - 7