Forum Discussion

beatrizcorrea's avatar
beatrizcorrea
New Member
2 years ago
Solved

DAX Conditional Formatting - Multiple Conditions traffic lights - PBI

I need to do conditional formatting where I will use semaphores. If the service level is greater than the target value, the traffic light will turn green, If the service level is less than the target...
  • beatrizcorrea's avatar
    2 years ago

    I found the solution, it is:

    FarolKPI =
    VAR target = SELECTEDVALUE(DimService[Target])
    VAR cor =
        IF({_FactService_Measures[ServiceLevel]} >= target, "Green",
            IF({_FactService_Measures[ServiceLevel]} < target && {_FactService_Measures[ServiceLevel]} <= 0.5, "Red", "Yellow"))
    VAR icone = "data&colon;image/svg+xml;utf8," &
    "<svg
    xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 130'>

    <circle cx='60' cy='60' r='55'
    fill='" & cor & "' />
    </svg>"

    RETURN icone