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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors