SSRS - Color coding values based on data compare

SQL 321 Reputation points
2020-09-03T15:33:32.493+00:00

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.

22494-colorcoding.jpg

In the above example the highlighted in red are matching.

Thanks!

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,940 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 37,671 Reputation points
    2020-09-04T01:53:40.043+00:00

    Hi,

    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.

    Regards,

    Zoe

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SQL 321 Reputation points
    2020-09-03T17:44:54.13+00:00

    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")

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.