Forum Discussion

jjagadish's avatar
jjagadish
New Member
4 years ago
Solved

Matrix - Conditional formatting based on column values in three rows.

I need to compare values in the column in three rows within a group and highlight the group is atleast one value is different. For example:   In the above example I want to highlight all rows...
  • jaideepnema's avatar
    4 years ago

    Hi jjagadish ,

    There might be a better way of doing this but you can use the following measure for conditional formatting:

    Flag =
    var value1=CALCULATE(SUM(Data[Value]),Data[ID]=1,ALLEXCEPT(Data,Data[Code]))
    var value2=CALCULATE(SUM(Data[Value]),Data[ID]=2,ALLEXCEPT(Data,Data[Code]))
    var value3=CALCULATE(SUM(Data[Value]),Data[ID]=3,ALLEXCEPT(Data,Data[Code]))
    return if(value1=value2 && value2=value3 && value3=value1,1,0)
     
    Check the attached file
     

    Please accept this as a solution if your question has been answered !!

    Appreciate a Kudos ðŸ˜€