Forum Discussion

dtem's avatar
dtem
Regular Visitor
3 years ago
Solved

Conditional formatting when values are similar

Hi All,   I have a Table Visual that shows my data as shown below where I have business units in one company that conduct business with each other. Account1 belongs to Company1, Account2 belongs to...
  • v-jianboli-msft's avatar
    3 years ago

    Hi dtem ,

     

    Please try:

    First, unpivot the Account columns:

    Then create a matrix visual:

    Conditional format:

    Measure = 
    var _a = "Account"&RIGHT(SELECTEDVALUE('Table (2)'[Company]),LEN(SUBSTITUTE(SELECTEDVALUE('Table (2)'[Company]),"Company","")))
    var _b = "Company"&RIGHT(SELECTEDVALUE('Table (2)'[Attribute]),LEN(SUBSTITUTE(SELECTEDVALUE('Table (2)'[Attribute]),"Account","")))
    var _c = CALCULATE(SUM('Table (2)'[Value]),FILTER(ALL('Table (2)'),[Attribute]=_a&&[Company]=_b))
    return IF(SUM('Table (2)'[Value])+_c=0,"Green","Red")

    Final output:

    Best Regards,

    Jianbo Li

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