Forum Discussion

Renit's avatar
Renit
Frequent Visitor
10 months ago
Solved

Hide or Show table visual based on data available

 

I have a three-page Power BI report. On the first page, there are Group and Month slicers, which are synced and used across the second and third pages.

On the second page, there are several visuals, including a table visual that displays one column from a table and two measures.

The requirement is:

  • If the table visual has no data (i.e., it’s blank), it should be hidden.
  • If there is data, the table should be visible.

To achieve this, I created a DAX measure that calculates a total, and if the total is blank, I set a flag. I then used bookmarks and applied this flag in the visual-level filter to control the visibility.

However, the issue is that when I change the Group slicer, the table visibility does not update dynamically based on the slicer selection.

I’m looking for a solution that ensures the table visual shows or hides dynamically based on the data returned by the slicer selections.

Any suggestions are appreciated

  • I achieved this by using a slicer in the show and hide bookmarks, passing 0 and 1 values accordingly, and keeping the slicer hidden within the bookmarks.

7 Replies

  • Hi Renit,

     Power BI doesn’t natively provide an option to completely hide visuals (like a table) based on slicer or filter selections. However, you can create a similar effect — making the table appear invisible when no data is available — by combining a simple DAX measure with visual-level filtering.

    Here’s how you can achieve this:

    Create a Measure:
    Create a measure that counts the no of rows based on the current slicer selection:

    Table Row Count =
    COUNTROWS (
        FILTER ( 'YourTable', --apply any filters if needed-- )
    )

    Now Apply a Visual-Level Filter

    1. Add this measure to the Filters on this visual pane of your table view.

    2. Set the filter condition to Show items when the value is greater than 0.

      With this setup, the table visual won’t display any data when there are no matching rows for the selection. However, the visual space will still be retained on the report page — it will just appear blank to the user.

      🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

      💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

      🔗 Curious to explore more? [Discover here]

    • Renit's avatar
      Renit
      Frequent Visitor

      But column headers of table will appear eventhough no data is available. How to handle this

      • v-aatheeque's avatar
        v-aatheeque
        Community Support

        Hi Renit 

        Power BI does not currently support completely hiding visuals or their headers dynamically based on slicer or filter selections. Even when no data is returned, the column headers of a table will still be displayed.

  • Renit's avatar
    Renit
    Frequent Visitor

    I achieved this by using a slicer in the show and hide bookmarks, passing 0 and 1 values accordingly, and keeping the slicer hidden within the bookmarks.