Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
taylorb
Helper I
Helper I

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.

 

hotdogs.png

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@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.

jdbuchanan71_1-1613601097295.png

jdbuchanan71_2-1613601200596.png

Here is the result.

jdbuchanan71_3-1613601244393.png

 

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@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.

jdbuchanan71_1-1613601097295.png

jdbuchanan71_2-1613601200596.png

Here is the result.

jdbuchanan71_3-1613601244393.png

 

 

 

This works! Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.