The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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"
)
Solved! Go to Solution.
I was wrong: IT WORKS. I leave it here for reference.
I was wrong: IT WORKS. I leave it here for reference.
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |