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 August 31st. Request your voucher.

Reply
acg
Resolver I
Resolver I

SWITCH(TRUE(), Contains - specific conditions

The variable [Sub-sector?] in the table 'fact_countries' contains different job titles that need to be graded according to their perceived Risk into: "High Risk", "Medium "  and "Low Risk". Everything else goes into " not specified". 

 

Why is the below code setting all varibles to High Risk? 

 

 

Risk =

SWITCH(TRUE(),

  CONTAINS(fact_countries, fact_countries[Sub-sector?],"Derivative issuer")

     || CONTAINS(fact_countries, fact_countries[Sub-sector?],"Derivatives issuer")

    || CONTAINS(fact_countries, fact_countries[Sub-sector?],"Derivatives issuerOther")

    ,"High Risk",

   CONTAINS(fact_countries, fact_countries[Sub-sector?],"Fund manager")

    || CONTAINS(fact_countries, fact_countries[Sub-sector?],"Fund managerBrokers / Custodians")

    || CONTAINS(fact_countries, fact_countries[Sub-sector?],"Fund managerBrokers / CustodiansDIMS provider")

 

  ,"Medium Risk",

   CONTAINS(fact_countries, fact_countries[Sub-sector?],"Issuer of securities")

    || CONTAINS(fact_countries, fact_countries[Sub-sector?],"Other")

    || CONTAINS(fact_countries, fact_countries[Sub-sector?],"Trustee corporation / Licensed supervisor")

 

  ,"Low Risk",

  "Not specified"

)

1 ACCEPTED SOLUTION
acg
Resolver I
Resolver I

I was wrong: IT WORKS. I leave it here for reference. 

View solution in original post

1 REPLY 1
acg
Resolver I
Resolver I

I was wrong: IT WORKS. I leave it here for reference. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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