The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |