Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
10 | |
9 | |
7 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
10 |