Forum Discussion

vsteinbahs's avatar
vsteinbahs
Icon for Helper I rankHelper I
6 years ago
Solved

Conditional formatting of cell values in Matrix visual

Hi, I'm trying to highlight cell background in the Matrix visual where cell value is greater then the previous value in the same row.  Is it possible to do in the current version of Power BI?  A scr...
  • v-yingjl's avatar
    6 years ago

    Hi vsteinbahs ,

    You can create the following measure:

     

    Measure =

    var A = CALCULATE(SUM('Table'[Sales]))

    var B = CALCULATE(SUM('Table'[Sales]),DATEADD('Table'[Date],-1,DAY))

    return

    IF(A > B,"#FFFF00",BLANK())

     

    Then in Matrix Format, choose conditional format:

    ,

     enable Background color and select ‘Advanced controls’:

    choose Format by Field value and select previous measure under Based on filed

     

    Here is the demo , please try it:

    PBIX 

     

    Best Regards,

    Yingjie Li

     

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