# PowerTable Highlight different value than Row above

**URL:** <https://forum.inductiveautomation.com/t/powertable-highlight-different-value-than-row-above/54783>\
**Category:** Ignition\
**Created:** [January 7, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/powertable-highlight-different-value-than-row-above/54783 "2022-01-07T19:29:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregory.sachs](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@gregory.sachs](https://forum.inductiveautomation.com/u/gregory.sachs)\
**Post date:** [January 7, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/powertable-highlight-different-value-than-row-above/54783/1 "2022-01-07T19:29:11Z")

</div>

I’ve got a power table that gives me a list of orders and material needed for assembly. I’d like to use configurecell to change the color of a cell that is different from the value immediately above that, but I cannot figure out how to do it. I see rowIndex and columnIndex, but I haven’t figured out how to do value at rowIndex-1.  
Any pointers?  
Thanks!

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [January 7, 2022, 8:53pm UTC](https://forum.inductiveautomation.com/t/powertable-highlight-different-value-than-row-above/54783/2 "2022-01-07T20:53:00Z")

</div>

What you want is something like this?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/967843aeb4fc2f25aca0ffff0211cebd1876cb7f.png)

If so, you could use something like this:

```auto
   Column_I_Want_to_Monitor = 3
   #Defines what column will be configured
   if colIndex == Column_I_Want_to_Monitor and rowIndex > 0:
   #Checks if the column is the right one and that it's not the first row
   	previousCellValue = self.data.getValueAt(rowIndex-1,colIndex)
   	#On the Power Chart's dataset, finds the value at the previous cell
   	if previousCellValue != value:
   		return {'background': 'red'}

```

I hope this helps!

---

<div class="post-metadata">

**Author:** ![gregory.sachs](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@gregory.sachs](https://forum.inductiveautomation.com/u/gregory.sachs)\
**Post date:** [January 10, 2022, 7:58pm UTC](https://forum.inductiveautomation.com/t/powertable-highlight-different-value-than-row-above/54783/3 "2022-01-10T19:58:34Z")

</div>

That was perfect, thanks!  
I tweaked slightly due to using text column;

```auto
        Column_I_Want_to_Monitor = 5
	#Defines what column will be configured
	if colIndex == Column_I_Want_to_Monitor and rowIndex > 0:
	 #Checks if the column is the right one and that it's not the first row
	 	previousCellValue = self.data.getValueAt(rowIndex-1,colIndex)
	 #On the Power Chart's dataset, finds the value at the previous cell
	 	if previousCellValue != textValue:
	 		return {'background': 'red'}

```
