Using IIF Expression in SSRS

Cassandra 41 Reputation points
2021-02-02T07:38:23.33+00:00

Hi,
I have a table, as shown below:
62862-00.jpg
Now,I want to hide the rows where all 3 columns are 0.
Here is my expression:

=IIF((Fields!PastVal.Value=0) AND (Fields!CurrentVal.Value=0) AND (Fields!EstimatedVal.Value=0),False,True)  

But no data is returned except the column heading.
Thanks in advance!

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

Accepted answer
  1. Joyzhao-MSFT 15,591 Reputation points
    2021-02-02T07:59:05.583+00:00

    Hi @Cassandra ,
    Are you using Row Visibility? The True or False is for Hiding the Row yet you set it to false if they equal 0.
    62892-03.jpg
    Try the following expression:

    =IIF((Fields!PastVal.Value=0) AND (Fields!CurrentVal.Value=0) AND (Fields!EstimatedVal.Value=0), True, False)  
    

    Are your data rows using SUM? If so, your expression would need to SUM also.
    The expression is like so:

    =IIF(SUM(Fields!PastVal.Value) = 0 AND SUM(Fields!CurrentVal.Value) = 0 AND SUM(Fields!EstimatedVal.Value) = 0, True, False)  
    

    Hope this helps.
    Regards,
    Joy


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.