Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
LD
Frequent Visitor

Convert Spotfire Condition

Please, How I can convert following Spotfire condition in Power Bi?

 

case  when ([POSOWNER]="PACKAGING") or ([POSOWNER]="WAREHOUSE") then "P&WH"
 when [POSOWNER]="ASEPTIC" then "ASEPTIC"
 when [POSOWNER]="QC" then "QC"
 when [POSOWNER]="BACTERIAL PRIMARY" then "BACTERIAL PRIMARY"
 when [POSOWNER]="BACTERIAL GLYCO" then "BACTERIAL PRIMARY"
 when [POSOWNER]="BACTERIAL OMV" then "BACTERIAL PRIMARY"
 when [POSOWNER]="PRODUCT RELEASE" then "PRODUCT RELEASE"
else "OTHER" end

 

Thank you

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @LD 

try SWITCH()

Column = SWITCH([POSOWNER],
"PACKAGING", "P&WH",
"WAREHOUSE", "P&WH",
"ASEPTIC","ASEPTIC",
"QC","QC",
BACTERIAL PRIMARY","BACTERIAL PRIMARY",
"BACTERIAL GLYCO", "BACTERIAL PRIMARY",
"BACTERIAL OMV" , "BACTERIAL PRIMARY",
"PRODUCT RELEASE", "PRODUCT RELEASE",
"OTHER"
)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @LD 

try SWITCH()

Column = SWITCH([POSOWNER],
"PACKAGING", "P&WH",
"WAREHOUSE", "P&WH",
"ASEPTIC","ASEPTIC",
"QC","QC",
BACTERIAL PRIMARY","BACTERIAL PRIMARY",
"BACTERIAL GLYCO", "BACTERIAL PRIMARY",
"BACTERIAL OMV" , "BACTERIAL PRIMARY",
"PRODUCT RELEASE", "PRODUCT RELEASE",
"OTHER"
)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

You can do it in two ways

1 which is above suggested using switch and another one is nested if statements.

But as per coding point of view switch functions are better for such requirements.

Thanks
Pravin

If it resolves your problem Mark it as a solution and give Kudos.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.