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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.