Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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”,” ”))
Solved! Go to 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.
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
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |