SSRS - Color coding values based on data compare

SQL 201 Reputation points

Hi Folks:

We have SSRS report (2016) with 2 columns Qty1 and Qty2 and want the record colored (red) If the Qty1 and Qty2 are matching. The Qty2 column has records in 5 decimal places and we want to round off to 3 decimal when comparing the values. I need help with formula.


In the above example the highlighted in red are matching.


SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,122 questions
No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 18,896 Reputation points Microsoft Employee


    You may try like this:

    =iif(Round(cdbl(Fields!Qty1.Value),3)=Round(cdbl(Fields!Qty2.Value),3),"Red","No Color")

    If you have any question, please feel free to let me know.

    If your problem has been solved, please mark "accepted answer" on my reply, thanks for your understanding.



    No comments

1 additional answer

Sort by: Most helpful
  1. SQL 201 Reputation points

    This does not work when I put it for Background Color

    =IIf(Round(Fields!Qty1.Value,3) = Round(Fields!Qty2.Value,3),"Red","No Color")

    No comments