Forum Discussion
Anonymous
6 years agoNot applicable
Help with Date Calculated column
Hi all, I am trying to create a calculated column where in if date is equal to "2019/11/24" then print Static otherwise the date value. I am using the below two logic but keep getting an error - ...
- 6 years ago
Try like
Column = If(Table1[date] = Date(2019,11,24),"Static",format(Table1[date],"dd-mm-yyyy hh:mi:ss"))
for full set of options refer
https://docs.microsoft.com/en-us/dax/custom-date-and-time-formats-for-the-format-function
edhans
6 years agoCommunity Champion
Go into Power Query (Transform Data button on home ribbon) and verify that is truly a date column. I bet it shows ABC/123 as the column data type. Click that and change it to date, or date/time.
Just because visually it looks like a date doesn't mean Power BI will see it as a date. It must actually be the Date data type.