This article demonstrates how to change the item color in a gallery based on its value.
Showing the items in a different color can be incredibly useful for improving user experience and making it easier for users to spot important information quickly.
Here, we have a gallery displaying employee’s information.

Let’s modify the department color: if the department is “CS,” set the color to red, otherwise, keep it as black.

Now, write the following formula. It will check if the department is “CS” and change the color to red otherwise, it will remain black.
If( ThisItem.Department = "CS", Color.Red, Color.Black )
Note that,
Once you have completed this, you will see that the color has changed for the “CS” department.

Let’s write the following formula, which will check each department and assign the appropriate color.
If( ThisItem.Department = "CS", Color.Red, If( ThisItem.Department = "Finance", Color.Green, If( ThisItem.Department = "HR", Color.Blue, Color.Black ) ) )
You can now see that the colors have been updated for all departments accordingly.

Also read..
Highlight the selected item in gallery
Add Alternate background color to rows
Sort Items in gallery Power Apps
![]()
