Forum Discussion
JennyMilf
Helper I
3 years agoConvert text to Date
Hi everyone, How can I convert Year-month from text to Date? I tried: YearMonth_Date = DATE(LEFT(Table[YearMonth], 4), RIGHT(Table[YearMonth], 2), 1) but it's not work Thank you
jaweher899
Impactful Individual
3 years agoplease try
YearMonth_Date = DATE(
YEAR(DATEVALUE("01-" & RIGHT(Table[YearMonth], 2) & "-" & LEFT(Table[YearMonth], 4))),
MONTH(DATEVALUE("01-" & RIGHT(Table[YearMonth], 2) & "-" & LEFT(Table[YearMonth], 4))),
1
)