I want to set a column value before 2021-1-20 as 0. So I need to compare date time in data. Here is my wrong code.
ColumnValue = IF([MyDate]>="1/20/2021",
SWITCH([Key],
"caseA",[Value],
"caseB",[Value],
"caseC",[Value],
"caseD",-1*[Value],
"caseE",-1*[Value],
0
),0)
However, it hints that DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values. But I don't know how to compare DAX date time.