Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
atavano
Frequent Visitor

Suppress/Hide Dataset fields that are not in a table/matrix/chart, if they are null

Hello! I am really new to Power BI Report Builder so I am still learning my way around. 

 

I am building a report for our tenant's leases (Lease Abstract). All of the data is imported from a SQL server and this particular DataSet is called DataSet1. I am trying to hide these below fields IF they are Null values. 

atavano_0-1667414894981.png

I do not want to change the query to exlude results that have null values in these columns (WHERE statement). So, for example, in this particular lease abstract amendments 2-10 have null values but amendment 1 does not: 

atavano_2-1667415169575.png

Is there any way to hide amendment 2-10? I have tried using the textbox properties and used "Show or hide based on an expression". I have tried

[=IIF(IsNothing(First(Fields!Amendment_1.Value, "DataSet1")))] 

[=IIF(First(Fields!Amendment_1.Vlaue, "DataSet1") = NULL, true, false)] [as well as false, true]

[=IIF(Fields!Amendment_1.Value = NULL, true, false)] [as well as false, true}

 

All of these return a series of errors such as

"Overlaod resultion falied becuase no accessible 'IIF' accepts this number of arguements" - this was returned on the first attempt above. 

"The Hidden expression for the text box 'Amendment_1' refers to the field 'Amendement_1'. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case." - I get this error on the last two attempts above. 

 

Any suggestions? 

 

 

3 REPLIES 3
atavano
Frequent Visitor

Thank you! 

Is there any way to make the fields a table with the headers on the left side (row headers) instead of column headers? I have tried a matrix and that didn't really work either (I might be putting it together wrong) 

d_gosbell
Super User
Super User

The first expression should work, but the IIF function expects 3 parameters, an expression the the value to return if the expression is true and the value to return if the expression is false.

 

In your example you would want to return False if the field is Nothing and True if it has a value so something like the following will work.

 

[=IIF(IsNothing(First(Fields!Amendment_1.Value, "DataSet1")), False, True)]

 

Note that because you have 10 hard coded text boxes you can hide these from being displayed, but this will not re-claim the blank space. If you want the blank space to expand/collapse you would be better to rebuild this so that the attachements are rows in a dataset, then you could build this output as a table rather than individual text boxes.

I tried this on Amendment 2 and this is the error i got 

 

atavano_0-1667505347590.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.