Forum Discussion
balar2007
5 years agoRegular Visitor
SWITCH or IF
I need to transform a case statement which i have written in spotfire to Power Bi case WHEN [Formula]~="EBOB" THEN "MOGAS" WHEN [Formula]~="G01" THEN "GASOIL" WHEN [Formula]~="G50" THEN "GASOIL" ...
Anonymous
5 years agoNot applicable
Hi balar2007 ,
As amitchandak said, Switch True is a good idea.
In addititon, you can also try IF.
Formula =
IF (
[Formula] = "EBOB",
"MOGAS",
IF (
[Formula] = "G01",
"GASOIL",
IF (
[Formula] = "G50",
"GASOIL",
IF (
[Grade] = "DAOWA",
"FO",
IF (
[Formula] = "BOB10ARGM"
&& [Grade] = "M5859",
"MOGAS",
IF (
[Formula] = "FRONTLINEICELS"
&& [Grade] = "HYWAX",
"FO",
IF ( [Client] = "MFPERNIS" && [Formula] = "BIPEB", "HEDGES", [Formula] )
)
)
)
)
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.