Forum Discussion

HDD328's avatar
HDD328
Frequent Visitor
1 year ago
Solved

Trying to format individual values in a matrix table

I've got a matrix table with actual values in it. I am trying to format each individual value based on targets from a seperate table. this is the mesure i've made to format this. OilLightsFormattin...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi HDD328 

     

    For your question, here is the method I provided:

     

    Here's some dummy data

     

    “LossByCodeActual”

     

    “LossByCodeTargets”

     

     

    Create a measure.

     

    OilLightsFormatting = 
    var _code = SELECTEDVALUE('LossByCodeActual'[Loss By Code])
    RETURN
    IF(
        SUM('LossByCodeActual'[Values]) > 
        LOOKUPVALUE('LossByCodeTargets'[Values], 'LossByCodeTargets'[Loss By Code], _code), 
        "Red", 
        "Green"
    )

     

    Here is the result.

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.