Forum Discussion
Jay2022
Helper IV
2 years agoMUltiple 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”,” ”))
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.
3 Replies
- Dangar332
Resident Rockstar
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”,” ” )