Forum Discussion
IF or SWITCH multiple values not getting syntax right
Thank you !! And what does it look like when the name of the new column should be SUPDISCDEF?
BartVlek , not sure what you mean by that. A new column like
SUPDISCDEF =
Switch ( true(),
[supplier] = "COCACOLA" && [SHOP] = "AMSTERDAM" , 65.00,
[supplier] = "PEPSICOLA" && [SHOP] = "ROTTERDAM" , 60.00,
[SUPDISC]
)
- BartVlek6 years agoHelper II
I transformed your suggestion to the actual situation. The shop doesn't have a name, but a number as you can see.
When I then copy-paste it to PBI-desktop and run, I receive a syntaxis error. What can it be? Do I not need to add the name of the table?
LEVKORTDEF =
SWITCH (
TRUE (),
[LEVERANCIER] = "ALDIPRESS"
&& [FIL] = "1", 65.00,
[LEVERANCIER] = "BETAPRESS"
&& [FIL] = "1", 60.00,
[LEVKORTING]
)- Anonymous6 years agoNot applicable
Hi BartVlek ,
Please try to update the formula of your measure as below to remove double quotation since shop is number type:
LEVKORTDEF =
SWITCH (
TRUE (),
[LEVERANCIER] = "ALDIPRESS"
&& [FIL] = 1, 65.00,
[LEVERANCIER] = "BETAPRESS"
&& [FIL] =1 , 60.00,
[LEVKORTING]
)If the above method didn't resolve your problem, please provide the screen shot of syntax error and related formula. Thank you.
Best Regards
Rena
- BartVlek6 years agoHelper II
Thank you !