Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Jay2022
Helper IV
Helper IV

IF &&

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 2024","No"))
 
I'd also want to follow this with all store C's regardless of Order Date are Before April 2024
 
Any help greatly appreciated 
1 ACCEPTED SOLUTION
ChiragGarg2512
Solution Sage
Solution Sage

@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.

View solution in original post

4 REPLIES 4
Jay2022
Helper IV
Helper IV

Brilliant Thank you for your help

ChiragGarg2512
Solution Sage
Solution Sage

@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
Solution Sage

@Jay2022 , 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")

Thank 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.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.