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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Jay2022
Helper III
Helper III

MUltiple IF and statements

Hi I keep getting Syntax errors when I try the following formula. Where am I going wrong 

 

New_Column = IF('Table'[Store]= "A", "A",

IF('Table'[Store]= "B", "B",

IF('Table'[Store]= "C", && (‘Table’[Sales Date]<=TODAY(), “B”

IF('Table'[Store]= "D", && (‘Table’[Sales Date]<=TODAY(), “B”

IF('Table'[Store]= "C", && (‘Table’[Sales Date]>TODAY(), “C”

IF('Table'[Store]= "D", && (‘Table’[Sales Date]>TODAY(), “D”,” ”))

1 ACCEPTED SOLUTION

Hi, @Jay2022 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

View solution in original post

3 REPLIES 3
Dangar332
Super User
Super User

Hi, @Jay2022 
@Jay2022 


try below code remove (" , ")

 

 

 

 

New_Column = IF('Table'[Store]= "A", "A",

IF(
'Table'[Store]= "B", "B",

IF('Table'[Store]= "C" && ‘Table’[Sales Date]<=TODAY(), “B”,

IF('Table'[Store]= "D" && ‘Table’[Sales Date]<=TODAY(), “B”,

IF('Table'[Store]= "C" && ‘Table’[Sales Date]>TODAY(), “C”,

IF('Table'[Store]= "D" && ‘Table’[Sales Date]>TODAY(), “D”,” ”)
)))))

 

 

 

or use switch() function

 

 

New_Column = 
switch(true(),
'Table'[Store]= "A", "A",
'Table'[Store]= "B", "B",
'Table'[Store]= "C" && ‘Table’[Sales Date]<=TODAY(), “B”,
'Table'[Store]= "D" && ‘Table’[Sales Date]<=TODAY(), “B”,
'Table'[Store]= "C" && ‘Table’[Sales Date]>TODAY(), “C”,
'Table'[Store]= "D" && ‘Table’[Sales Date]>TODAY(), “D”,” ”
)

 

 

 

Hi, @Jay2022 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Thank you 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.