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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
SeniorJunior
Frequent Visitor

Hide blank rows when data exists, otherwise show blank.

Hi all, 

 

A strange one, I have the following table:

CustomerIDProduct NameCustomer Status
1001LaptopActive
1002SmartphoneInactive
1003TabletActive
1004 Active
1005HeadphonesInactive
1001 Active
1006 Active
1007KeyboardActive
1008MouseInactive
1009LaptopActive
1001MouseActive

 

And I want to use a Power BI table to display this information, but with a filter so that if the product name is available it will show, but if not, it will provide a blank row - BUT if there's a product, do not show a blank row.

 

So, the output would be

CustomerIDProduct NameCustomer Status
1001LaptopActive
1001MouseActive
1002SmartphoneInactive
1003TabletActive
1004 Active
1005HeadphonesInactive
1006 Active
1007KeyboardActive
1008MouseInactive
1009LaptopActive

 

So as you can see the blank row for 1001 has been removed, but the other customers who have blank but no other product details remain. 

 

How would you approach this? Would it be best to approach it by providing a comparison between MembershipID and Product Name and then if certain values are met it returns the product, or the blank row? Also note that the CustomerID could appear more than once for orders with different products and I would like this to be on different rows as opposed to amalgamated.

 

Thanks for any pointers! 

1 ACCEPTED SOLUTION
Kedar_Pande
Super User
Super User

@SeniorJunior 

Create a Calculated Column

ShowRow =
IF(
'Table'[Product Name] <> BLANK() ||
COUNTROWS(
FILTER(
'Table',
'Table'[CustomerID] = EARLIER('Table'[CustomerID]) &&
'Table'[Product Name] <> BLANK()
)
) = 0,
1,
0
)

Add the calculated column ShowRow to your table.
Apply a filter on the visual: ShowRow = 1.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

3 REPLIES 3
Bibiano_Geraldo
Super User
Super User

Hi @SeniorJunior ,
Add a calculated column in your data model to flag the rows you want to filter out. Use the following DAX formula:

 

 

IsRowToShow =
VAR CurrentCustomerID = 'Table'[CustomerID]
VAR HasNonBlankProduct =
    CALCULATE(
        COUNTROWS('Table'),
        'Table'[CustomerID] = CurrentCustomerID,
        NOT(ISBLANK('Table'[Product Name]))
    )
RETURN
IF(
    ISBLANK('Table'[Product Name]) && HasNonBlankProduct > 0,
    FALSE,
    TRUE
)

 

 

Once the column is created, apply a visual-level filter by dragging the IsRowToShow column to the filter pane and set the filter to show only rows where IsRowToShow is TRUE

 

 

Kedar_Pande
Super User
Super User

@SeniorJunior 

Create a Calculated Column

ShowRow =
IF(
'Table'[Product Name] <> BLANK() ||
COUNTROWS(
FILTER(
'Table',
'Table'[CustomerID] = EARLIER('Table'[CustomerID]) &&
'Table'[Product Name] <> BLANK()
)
) = 0,
1,
0
)

Add the calculated column ShowRow to your table.
Apply a filter on the visual: ShowRow = 1.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Perfect - just what I needed! 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.