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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Meadsie
Regular Visitor

Format Cells showing difference in value

Hi all,

 

I have a problem that I cant work out how to solve.

 

I have a matrix consisting of 5 columns (B-F) and 5 rows (1-5)

 

Each of the cells in the matix contains a figure. 

 

for example Cell B3 = 100, Cell C3 = 150, Cell D3 = 120

 

I want to highlight the cells where the next cell value has gone up or down. If it has gone up colour the cell green, If it has gone down colour the cell red. any ideas please ?

 

So in teh example above, C3 would be GREEN, D3 would be RED

 

Any help would be greatly received.

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Meadsie,

 

If your original table is like this one:

 

pastedImage (2).png

 

Based on my test, we can take the following steps to work around to meet your requirement.

 

1.Add a custom column based on the table using the formula:

if  [type]= "B" then 1 else if [type] = "C" then 2 else if [type] = "D" then 3 else if [type] = "E" then 4 else 5

2.Create a column using the formula as below:

diff = var prevalue = CALCULATE(FIRSTNONBLANK(Table2[Column1],1),
FILTER(Table2,Table2[Cate]= EARLIER(Table2[Cate]) && (Table2[Custom]= EARLIER(Table2[Custom]))-1))
return
IF(ISBLANK(prevalue), BLANK(),Table2[Column1]-prevalue)

Then we can create the Matrix and set the font color as the picture below:

2.png

 

For more details, please check the pbxi as attached.
 
Regards,
Frank
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Meadsie,

 

Does this make sense? If yes, kindly mark the answer as solution please. Thanks a lot.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
v-frfei-msft
Community Support
Community Support

Hi @Meadsie,

 

If your original table is like this one:

 

pastedImage (2).png

 

Based on my test, we can take the following steps to work around to meet your requirement.

 

1.Add a custom column based on the table using the formula:

if  [type]= "B" then 1 else if [type] = "C" then 2 else if [type] = "D" then 3 else if [type] = "E" then 4 else 5

2.Create a column using the formula as below:

diff = var prevalue = CALCULATE(FIRSTNONBLANK(Table2[Column1],1),
FILTER(Table2,Table2[Cate]= EARLIER(Table2[Cate]) && (Table2[Custom]= EARLIER(Table2[Custom]))-1))
return
IF(ISBLANK(prevalue), BLANK(),Table2[Column1]-prevalue)

Then we can create the Matrix and set the font color as the picture below:

2.png

 

For more details, please check the pbxi as attached.
 
Regards,
Frank
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors