Forum Discussion

taylorb's avatar
taylorb
Helper I
5 years ago
Solved

Conditional Formatting a Matrix to Compare with Previous Row

I have data in a matrix and I want to add an icon that shows if it is higher or lower than the previous row. It looks like the only option is to compare the individual row to the highest and lowest values over all.

 

  • taylorb 

    I am assuming you have a measure that adds up the amounts in your table like.

    SUM = SUM ( YourTable[Amount] )

    And also that you have a dates table in your model.  If so you can write a measure like this.

     

    Change from Prior Day = 
    [SUM] - 
    CALCULATE([SUM],DATEADD(Dates[Date],-1,DAY))

    Then use that in a conditional formatting rule on the [Sum] value in your visual.

    Here is the result.

     

     

     

2 Replies

  • taylorb 

    I am assuming you have a measure that adds up the amounts in your table like.

    SUM = SUM ( YourTable[Amount] )

    And also that you have a dates table in your model.  If so you can write a measure like this.

     

    Change from Prior Day = 
    [SUM] - 
    CALCULATE([SUM],DATEADD(Dates[Date],-1,DAY))

    Then use that in a conditional formatting rule on the [Sum] value in your visual.

    Here is the result.