Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I currently have a SWITCH statement that looks for specific text and returns "Yes", "No" and this works fine. However, in addition to this I need to now add in another variable for:
Values that begin with "No harm sustained"......
I know I have to follow something like this:
if(left('Incidents'[Actual severity of impact],17) = "No harm sustained","Yes","No")
OR
VAR result1 = IF(LEFT(MIN(Incidents[Actual severity of impact],17) = "No harm sustained"), "Yes",resul
but I feel this will override my current measure.
My question is: is there a way to have my SWITCH statement (below) and also a LEFT statement for strings begining with "No harm sustained"?
Incidents[No harm / No Loss] =
VAR F_sp = SELECTEDVALUE('Reporting Period Filter'[RK_ReportingPeriod],MAX('Reporting Period Filter'[RK_ReportingPeriod]))
VAR F_rp = SELECTEDVALUE('ReportingPeriod'[RK_ReportingPeriod],F_sp)
VAR result = SWITCH(
SELECTEDVALUE('Incidents'[Actual severity of impact]),
"Air quality Monitoring not in line but no harm", "Yes",
"Breach of soil management requirements not resulting in damage", "Yes",
"No"
)
RETURN CALCULATE(result, KEEPFILTERS(ReportingPeriod[RK_ReportingPeriod] <= F_sp ), KEEPFILTERS(ReportingPeriod[RK_ReportingPeriod] = F_rp ))
Solved! Go to Solution.
VAR result = SWITCH(TRUE()
SELECTEDVALUE('Incidents'[Actual severity of impact])="Air quality Monitoring not in line but no harm", "Yes",
SELECTEDVALUE('Incidents'[Actual severity of impact])="Breach of soil management requirements not resulting in damage", "Yes",
SEARCH("No harm sustained", SELECTEDVALUE('Incidents'[Actual severity of impact]),1,0)=1,"Yes",
"No"
)
VAR result = SWITCH(TRUE()
SELECTEDVALUE('Incidents'[Actual severity of impact])="Air quality Monitoring not in line but no harm", "Yes",
SELECTEDVALUE('Incidents'[Actual severity of impact])="Breach of soil management requirements not resulting in damage", "Yes",
SEARCH("No harm sustained", SELECTEDVALUE('Incidents'[Actual severity of impact]),1,0)=1,"Yes",
"No"
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |