Forum Discussion
Jay2022
Helper IV
2 years agoIF &&&&
I'm trying to add a new column but keep getting an error message that the syntax is incorrect Before April 2024 = IF('Table'[Order Date]>"30/03/2024" && ('Table'[Store]=Store A,"Before April...
- 2 years ago
Jay2022 If 'Table'[Order Date] is in date format, try this
Before April 2024 =IF('Table'[Order Date]> DATE(2024, 03, 30)&& ('Table'[Store]=Store A),"Before April 2024","No")
The reason for error is the date is written as "30/03/2024" which makes it a string and thus can't be compared with a date column.
ChiragGarg2512
Solution Sage
2 years agoJay2022 , There is a need to change the formula as the open bracket is not at the correct place.
Try,
Before April 2024 =
IF('Table'[Order Date]>"30/03/2024"
&& ('Table'[Store]=Store A),"Before April 2024","No")
Jay2022
Helper IV
2 years agoThank you but its not working i'm getting the following error message
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.